mirror of https://github.com/espruino/BangleApps
Merge pull request #316 from Purple-Tentacle/master
Compass 0.02 - show text if uncalibratedpull/312/head
commit
745e4d38a9
|
@ -235,7 +235,7 @@
|
|||
{ "id": "compass",
|
||||
"name": "Compass",
|
||||
"icon": "compass.png",
|
||||
"version":"0.01",
|
||||
"version":"0.02",
|
||||
"description": "Simple compass that points North",
|
||||
"tags": "tool,outdoors",
|
||||
"storage": [
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
0.01: New App!
|
||||
0.02: Show text if uncalibrated
|
|
@ -20,10 +20,19 @@ Bangle.on('mag', function(m) {
|
|||
if (!Bangle.isLCDOn()) return;
|
||||
g.setFont("6x8",3);
|
||||
g.setColor(0);
|
||||
g.fillRect(70,0,170,24);
|
||||
g.fillRect(0,0,230,40);
|
||||
g.setColor(0xffff);
|
||||
g.setFontAlign(0,0);
|
||||
g.drawString(isNaN(m.heading)?"---":Math.round(m.heading),120,12);
|
||||
if (isNaN(m.heading)) {
|
||||
g.setFontAlign(-1,-1);
|
||||
g.setFont("6x8",2);
|
||||
g.drawString("Uncalibrated",50,12);
|
||||
g.drawString("turn 360° around",25,26);
|
||||
}
|
||||
else {
|
||||
g.setFontAlign(0,0);
|
||||
g.setFont("6x8",3);
|
||||
g.drawString(Math.round(m.heading),120,12);
|
||||
}
|
||||
g.setColor(0,0,0);
|
||||
arrow(oldHeading,0);
|
||||
arrow(oldHeading+180,0);
|
||||
|
|
Loading…
Reference in New Issue