diff --git a/apps/altimeter/ChangeLog b/apps/altimeter/ChangeLog new file mode 100644 index 000000000..5560f00bc --- /dev/null +++ b/apps/altimeter/ChangeLog @@ -0,0 +1 @@ +0.01: New App! diff --git a/apps/altimeter/app-icon.js b/apps/altimeter/app-icon.js new file mode 100644 index 000000000..1f8dfb637 --- /dev/null +++ b/apps/altimeter/app-icon.js @@ -0,0 +1 @@ +require("heatshrink").decompress(atob("mEw4UA///t9TmuV3+GJf4AN+ALVgf8BasP/4LVn//4ALUWgJUJBZUDBYJUIBZcP3/nKhEOt/WBZE5r+VKg0KgEVr9V3wLHqtaqt9sALElWAqoABt1QBZNeBYuq0ILCrVUBYulBYVWBYkCBYgABBZ8K1WVBYlABZegKQWqBQlVqALKqWoKQWpBYtWBZeqKRAAB1WABZZSHAANq0ALLKQ6qC1ALLKQ5UEAH4AG")) diff --git a/apps/altimeter/app.js b/apps/altimeter/app.js new file mode 100644 index 000000000..06c254a36 --- /dev/null +++ b/apps/altimeter/app.js @@ -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(); diff --git a/apps/altimeter/app.png b/apps/altimeter/app.png new file mode 100644 index 000000000..9c9d69077 Binary files /dev/null and b/apps/altimeter/app.png differ diff --git a/apps/altimeter/metadata.json b/apps/altimeter/metadata.json new file mode 100644 index 000000000..137ceb8ba --- /dev/null +++ b/apps/altimeter/metadata.json @@ -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} + ] +}