Update boot to use its own block

master
RKBoss6 2025-07-21 21:17:51 -04:00 committed by GitHub
parent aae381e787
commit c588a254d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 24 additions and 25 deletions

View File

@ -1,4 +1,4 @@
{
//Set LCD to zero every reboot
let s = require("Storage").readJSON("setting.json", 1) || {};
s.brightness = 0;
@ -8,6 +8,7 @@ require("Storage").writeJSON("setting.json", s);
let unlockedWithLongPress = false;
const longPressTime=400; //(ms)
Bangle.on('lock', function(isLocked) {
@ -17,10 +18,10 @@ Bangle.on('lock', function(isLocked) {
// Just unlocked — give a short delay and check if BTN1 is still pressed
setTimeout(() => {
if (digitalRead(BTN1)) {
unlockedWithLongPress = true;
//set brightness until. locked.
Bangle.setLCDBrightness(0.1);
setTimeout(()=>{
Bangle.setLCDBrightness(0);
},s.lcdTimeout*1000);
} else {
Bangle.setLCDBrightness(0);
}
@ -28,6 +29,4 @@ Bangle.on('lock', function(isLocked) {
}
});
}