Compass: 0.02

master
Purple-Tentacle 2020-04-17 16:38:33 +02:00 committed by GitHub
parent dcb2a6c2d9
commit 9a664ecae4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 45 additions and 34 deletions

2
apps/compass/ChangeLog Normal file
View File

@ -0,0 +1,2 @@
0.01: New App!
0.02: Show text if uncalibrated

View File

@ -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);
g.setFontAlign(0,0); if (isNaN(m.heading)) {
g.drawString(isNaN(m.heading)?"---":Math.round(m.heading),120,12); 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); g.setColor(0,0,0);
arrow(oldHeading,0); arrow(oldHeading,0);
arrow(oldHeading+180,0); arrow(oldHeading+180,0);