diff --git a/apps/longpressbuzz/ChangeLog b/apps/longpressbuzz/ChangeLog new file mode 100644 index 000000000..5560f00bc --- /dev/null +++ b/apps/longpressbuzz/ChangeLog @@ -0,0 +1 @@ +0.01: New App! diff --git a/apps/longpressbuzz/README.md b/apps/longpressbuzz/README.md new file mode 100644 index 000000000..7f094e191 --- /dev/null +++ b/apps/longpressbuzz/README.md @@ -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) diff --git a/apps/longpressbuzz/app.png b/apps/longpressbuzz/app.png new file mode 100644 index 000000000..582cb2e08 Binary files /dev/null and b/apps/longpressbuzz/app.png differ diff --git a/apps/longpressbuzz/boot.js b/apps/longpressbuzz/boot.js new file mode 100644 index 000000000..1a859a381 --- /dev/null +++ b/apps/longpressbuzz/boot.js @@ -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' }); diff --git a/apps/longpressbuzz/metadata.json b/apps/longpressbuzz/metadata.json new file mode 100644 index 000000000..1bc74650b --- /dev/null +++ b/apps/longpressbuzz/metadata.json @@ -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"} + ] +}