Create appb2.js

master
Ronin0000 2022-02-03 17:02:34 -08:00 committed by GitHub
parent 4198189fbb
commit 992f4cdf88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 0 deletions

16
apps/torch/appb2.js Normal file
View File

@ -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);