1
0
Fork 0

change the logic to buzz at boot instead of before reboot

master
thyttan 2023-04-03 19:46:38 +02:00
parent d410c5acad
commit e34728849f
3 changed files with 4 additions and 9 deletions

View File

@ -1,6 +1,6 @@
# Long Press, Buzz!
Buzz on long press (assumed and hardcoded to 1500ms) to indicate the watch will be reinitiated per your command.
Buzz at boot after a long press to indicate the watch was reinitiated per your command.
## Usage

View File

@ -1,6 +1 @@
let btnLoadTimeout = 1500; //Bangle.getOptions().btnLoadTimeout; // Hardcode value to minimize impact on load time at boot. Change to the commented out code to couple it to the actual system setting in the options object.
let buzzTimeout;
setWatch(function(e) { buzzTimeout = setTimeout(Bangle.buzz, btnLoadTimeout-100, 45, 0.35); }, BTN, {
repeat:true, edge:'rising' });
setWatch(function(e) { if (buzzTimeout) clearTimeout(buzzTimeout); }, BTN, {
repeat:true, edge:'falling' });
if (BTN.read()) Bangle.buzz(80,0.40);

View File

@ -2,13 +2,13 @@
"name": "Long Press, Buzz!",
"shortName":"LPB",
"version":"0.01",
"description": "Buzz on long press (assumed and hardcoded to 1500ms) to indicate the watch will be reinitiated per your command.",
"description": "Buzz at boot after a long press to indicate the watch was reinitiated per your command.",
"icon": "app.png",
"type": "bootloader",
"tags": "system",
"supports" : ["BANGLEJS2"],
"readme": "README.md",
"storage": [
{"name":"longpressbuzz.boot.js","url":"boot.js"}
{"name":"longpressbuzz.0.boot.js","url":"boot.js"}
]
}