From 992f4cdf88f0faa404d9def0d680d17aa096bc6d Mon Sep 17 00:00:00 2001 From: Ronin0000 <89286474+Ronin0000@users.noreply.github.com> Date: Thu, 3 Feb 2022 17:02:34 -0800 Subject: [PATCH] Create appb2.js --- apps/torch/appb2.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 apps/torch/appb2.js diff --git a/apps/torch/appb2.js b/apps/torch/appb2.js new file mode 100644 index 000000000..e15e3c9e1 --- /dev/null +++ b/apps/torch/appb2.js @@ -0,0 +1,16 @@ +const SETTINGS_FILE = "torch.json"; +let settings; + +function loadSettings() { + settings = require("Storage").readJSON(SETTINGS_FILE,1)|| {'bg': '#FFFFFF', 'color': 'White'}; +} + +loadSettings(); + +Bangle.setLCDPower(1); +Bangle.setLCDTimeout(0); +g.reset(); +g.setColor(settings.bg); +g.fillRect(0,0,g.getWidth(),g.getHeight()); +// Any button turns off +setWatch(()=>load(), BTN1);