mirror of https://github.com/espruino/BangleApps
Removes jbb app
parent
0cd385fbfb
commit
6a5bef65a3
|
@ -1,2 +0,0 @@
|
|||
0.01: First version trying out stuff
|
||||
0.02: First usable version
|
|
@ -1 +0,0 @@
|
|||
require("heatshrink").decompress(atob("mEwxH+AH4AvlYAVF7NVABdPAggublfVAAfU5gAKFzReCF4guL0RehFxZedF6Iu/F/hezF1AvB1YvOFzxevF54u/F6Qupqxe/FzovBLxougLxoOBACIvNwAuB6YvbXroANqqdQF4YuYLqBedDgNWdqYuZFp/+qwuC6i6nLzi6RF4nPF1peXFqgvCqouUXSheEABhrHRaovSFw9WFyo8O6vUXTb6SFodPF0xeCXTheVF1AvBwC6pLwjsBqoupF4SLqF2AvCFtYuvF4YurF4NWF1otsAH4AXA=="))
|
|
@ -1,53 +0,0 @@
|
|||
/**
|
||||
* draw the current level value
|
||||
*/
|
||||
function draw(level) {
|
||||
console.log('draw', level);
|
||||
// Clear the screen
|
||||
g.clear();
|
||||
g.setFontAlign(0, 0); // center font
|
||||
g.setFont("6x8", 8); // bitmap font, 8x magnified
|
||||
g.drawString(level + "%", 120, 80);
|
||||
g.setFont("6x8", 4);
|
||||
g.drawString("power", 120, 130);
|
||||
}
|
||||
|
||||
function getBatteryLevel() {
|
||||
level = E.getBattery();
|
||||
console.log('getBatteryLevel', level);
|
||||
|
||||
draw(level);
|
||||
|
||||
checkCharging(Bangle.isCharging());
|
||||
|
||||
// again, 10 secs later
|
||||
setTimeout(getBatteryLevel, 10E3);
|
||||
}
|
||||
|
||||
function checkCharging(charging) {
|
||||
console.log('checkCharging', charging);
|
||||
// Green LED
|
||||
//LED2.write(charging);
|
||||
if (charging) {
|
||||
g.setFontAlign(0, 0); // center font
|
||||
g.setFont("6x8", 3); // bitmap font, 3x magnifier
|
||||
g.drawString("charging", 120, 160);
|
||||
}
|
||||
}
|
||||
|
||||
function main() {
|
||||
console.log('starting jbb version 0.0.1');
|
||||
getBatteryLevel();
|
||||
}
|
||||
|
||||
g.clear();
|
||||
g.flip();
|
||||
Bangle.loadWidgets();
|
||||
Bangle.drawWidgets();
|
||||
|
||||
Bangle.on('charging', checkCharging);
|
||||
|
||||
main();
|
||||
|
||||
// Show launcher when middle button pressed
|
||||
setWatch(Bangle.showLauncher, BTN2, { repeat: false, edge: "falling" });
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"name": "Battery Power",
|
||||
"icon": "*jbb",
|
||||
"src": "-jbb"
|
||||
}
|
BIN
apps/jbb/app.png
BIN
apps/jbb/app.png
Binary file not shown.
Before Width: | Height: | Size: 1.6 KiB |
Loading…
Reference in New Issue