Add longpressbuzz app (boot code)

master
thyttan 2023-04-01 17:19:46 +02:00
parent 59b66684a6
commit d758d655b5
5 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1 @@
0.01: New App!

View File

@ -0,0 +1,15 @@
# Long Press, Buzz!
Buzz on long press (assumed and hardcoded to 1500ms) to indicate the watch will be reinitiated per your command.
## Usage
Just install and it will run as boot code.
## Requests
Mention @[thyttan](https://github.com/thyttan) in an issue to the official [BangleApps repository](https://github.com/espruino/BangleApps/issues) for bug reports and feature requests.
## Creator
[thyttan](https://github.com/thyttan)

BIN
apps/longpressbuzz/app.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,6 @@
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, 30, 0.30); }, BTN, {
repeat:true, edge:'rising' });
setWatch(function(e) { if (buzzTimeout) clearTimeout(buzzTimeout); }, BTN, {
repeat:true, edge:'falling' });

View File

@ -0,0 +1,14 @@
{ "id": "longpressbuzz",
"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.",
"icon": "app.png",
"type": "bootloader",
"tags": "",
"supports" : ["BANGLEJS2"],
"readme": "README.md",
"storage": [
{"name":"longpressbuzz.boot.js","url":"boot.js"}
]
}