Add altimeter app

pull/1664/head
Gordon Williams 2022-04-06 15:09:41 +01:00
parent c48a951f2d
commit 459fb273f1
5 changed files with 48 additions and 0 deletions

1
apps/altimeter/ChangeLog Normal file
View File

@ -0,0 +1 @@
0.01: New App!

View File

@ -0,0 +1 @@
require("heatshrink").decompress(atob("mEw4UA///t9TmuV3+GJf4AN+ALVgf8BasP/4LVn//4ALUWgJUJBZUDBYJUIBZcP3/nKhEOt/WBZE5r+VKg0KgEVr9V3wLHqtaqt9sALElWAqoABt1QBZNeBYuq0ILCrVUBYulBYVWBYkCBYgABBZ8K1WVBYlABZegKQWqBQlVqALKqWoKQWpBYtWBZeqKRAAB1WABZZSHAANq0ALLKQ6qC1ALLKQ5UEAH4AG"))

34
apps/altimeter/app.js Normal file
View File

@ -0,0 +1,34 @@
// place your const, vars, functions or classes here
// clear the screen
g.clear();
var n = 0;
// redraw the screen
function draw() {
g.reset().clearRect(Bangle.appRect);
g.setFont("6x8").setFontAlign(0,0).drawString("Up / Down",g.getWidth()/2,g.getHeight()/2 - 20);
g.setFont("Vector",60).setFontAlign(0,0).drawString(n,g.getWidth()/2,g.getHeight()/2 + 30);
}
// Respond to user input
Bangle.setUI({mode: "updown"}, function(dir) {
if (dir<0) {
n--;
draw();
} else if (dir>0) {
n++;
draw();
} else {
n = 0;
draw();
}
});
// First draw...
draw();
// Load widgets
Bangle.loadWidgets();
Bangle.drawWidgets();

BIN
apps/altimeter/app.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1,12 @@
{ "id": "altimeter",
"name": "Altimeter",
"version":"0.01",
"description": "Simple altimeter that can display height changed using Bangle.js 2's built in pressure sensor.",
"icon": "app.png",
"tags": "tool,outdoors",
"supports" : ["BANGLEJS2"],
"storage": [
{"name":"altimeter.app.js","url":"app.js"},
{"name":"altimeter.img","url":"app-icon.js","evaluate":true}
]
}