commit
745e4d38a9
|
|
@ -235,7 +235,7 @@
|
||||||
{ "id": "compass",
|
{ "id": "compass",
|
||||||
"name": "Compass",
|
"name": "Compass",
|
||||||
"icon": "compass.png",
|
"icon": "compass.png",
|
||||||
"version":"0.01",
|
"version":"0.02",
|
||||||
"description": "Simple compass that points North",
|
"description": "Simple compass that points North",
|
||||||
"tags": "tool,outdoors",
|
"tags": "tool,outdoors",
|
||||||
"storage": [
|
"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;
|
if (!Bangle.isLCDOn()) return;
|
||||||
g.setFont("6x8",3);
|
g.setFont("6x8",3);
|
||||||
g.setColor(0);
|
g.setColor(0);
|
||||||
g.fillRect(70,0,170,24);
|
g.fillRect(0,0,230,40);
|
||||||
g.setColor(0xffff);
|
g.setColor(0xffff);
|
||||||
|
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.setFontAlign(0,0);
|
||||||
g.drawString(isNaN(m.heading)?"---":Math.round(m.heading),120,12);
|
g.setFont("6x8",3);
|
||||||
|
g.drawString(Math.round(m.heading),120,12);
|
||||||
|
}
|
||||||
g.setColor(0,0,0);
|
g.setColor(0,0,0);
|
||||||
arrow(oldHeading,0);
|
arrow(oldHeading,0);
|
||||||
arrow(oldHeading+180,0);
|
arrow(oldHeading+180,0);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue