Update widalt.wid.js
parent
5023dc09d9
commit
3832eaa6ae
|
|
@ -5,9 +5,9 @@
|
||||||
|
|
||||||
function readAltitude() {
|
function readAltitude() {
|
||||||
try {Bangle.getPressure().then((p)=>{
|
try {Bangle.getPressure().then((p)=>{
|
||||||
print("pressure read, altitude "+p.altitude.toFixed(0));
|
//print("pressure read, altitude "+p.altitude.toFixed(0));
|
||||||
if (Math.floor(p.altitude)!=lastAlt) {
|
if (Math.floor(p.altitude)!=lastAlt) {
|
||||||
print("altitude changed!");
|
//print("altitude changed!");
|
||||||
lastAlt=Math.floor(p.altitude);
|
lastAlt=Math.floor(p.altitude);
|
||||||
alt=p.altitude.toFixed(0);
|
alt=p.altitude.toFixed(0);
|
||||||
var w = WIDGETS["widalt"].width;
|
var w = WIDGETS["widalt"].width;
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
}
|
}
|
||||||
});}
|
});}
|
||||||
catch(err) {
|
catch(err) {
|
||||||
print("ERROR");
|
//print("ERROR");
|
||||||
setTimeout(readAltitude,1000);
|
setTimeout(readAltitude,1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
//if (Date().getTime()-lastDraw<6000) return;//!!!!!
|
//if (Date().getTime()-lastDraw<6000) return;//!!!!!
|
||||||
if (!Bangle.isLCDOn()) return;
|
if (!Bangle.isLCDOn()) return;
|
||||||
//lastDraw=Date().getTime();
|
//lastDraw=Date().getTime();
|
||||||
print("drawing");
|
//print("drawing");
|
||||||
g.reset();
|
g.reset();
|
||||||
g.setColor(g.theme.bg);
|
g.setColor(g.theme.bg);
|
||||||
g.fillRect(this.x, this.y, this.x + this.width, this.y + 23);
|
g.fillRect(this.x, this.y, this.x + this.width, this.y + 23);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue