• ill post the relevant sections (i guess). This is basically toplevel, everything else is just functions.

    Bangle.loadWidgets();
    Bangle.drawWidgets();
    
    Bangle.setOptions({
        lockTimeout: 0,
        backlightTimeout: 10000,
        btnLoadTimeout: 0,
        hrmSportMode: -1
    });
    
    NRF.setTxPower(8);
    
    var bootTimer = 0;
    setInterval(function() {
        if (BTN.read())
            bootTimer++;
        else bootTimer=0;
    
        if (bootTimer<10) E.kickWatchdog();
    }, 2000);
    
    Graphics.prototype.setFontAnton = function(scale) {
        // Actual height 69 (68 - 0)
    .
    .
    .
    .
    setDrawClock();
    onInit(); // set up our new services
    initGraphics();
    
    function onInit() {
        NRF.on('connect', function () { connected = true;
            uiLog("connected");
        });
        NRF.on('disconnect', function () { connected = false;
            uiLog("disconnected");
            NRF.eraseBonds(onBondErased);
        });
    
        NRF.on('bond', function(status) {
            uiLog("bond: " + status);
            if(status == "success"){
                connected = true;
            } else {
                connected = false;
            }
        });
    
        NRF.on('advertising', function(isAdvertising) {
            uiLog("advertising: " + isAdvertising);
        });
    
        NRF.setServices({...});
    
        uiLog("Waiting..","Bluetooth Connection");
        setInterval(stepCount, 30000);
        setInterval(batteryPercentage, 5000);
        Bangle.on('accel', onAccel);
        Bangle.on('HRM-raw', onHRM);
        Bangle.setHRMPower(1, "app");
    }
    
About

Avatar for Ganblejs @Ganblejs started