2022-02-02 23:34:12 +00:00
|
|
|
const SETTINGS_FILE = "torch.json";
|
2022-02-03 00:01:40 +00:00
|
|
|
let settings;
|
2022-02-02 23:34:12 +00:00
|
|
|
|
|
|
|
function loadSettings() {
|
|
|
|
settings = require("Storage").readJSON(SETTINGS_FILE,1)|| {'bg': '#FFFFFF', 'color': 'White'};
|
|
|
|
}
|
|
|
|
|
2022-02-03 00:07:08 +00:00
|
|
|
loadSettings();
|
|
|
|
|
2020-03-03 15:59:00 +00:00
|
|
|
Bangle.setLCDPower(1);
|
|
|
|
Bangle.setLCDTimeout(0);
|
|
|
|
g.reset();
|
2022-02-02 23:34:12 +00:00
|
|
|
g.setColor(settings.bg);
|
2020-03-03 15:59:00 +00:00
|
|
|
g.fillRect(0,0,g.getWidth(),g.getHeight());
|
|
|
|
// Any button turns off
|
|
|
|
setWatch(()=>load(), BTN1);
|
2022-02-04 15:00:13 +00:00
|
|
|
if (global.BTN2) setWatch(()=>load(), BTN2);
|
|
|
|
if (global.BTN3) setWatch(()=>load(), BTN3);
|
|
|
|
|