Speedo app: Allow widgets
This allows e.g. GPS Recorder to work in the background while running Speedomaster
parent
51bf1d4ae4
commit
3dcd5820fc
|
|
@ -286,7 +286,7 @@
|
||||||
{ "id": "speedo",
|
{ "id": "speedo",
|
||||||
"name": "Speedo",
|
"name": "Speedo",
|
||||||
"icon": "speedo.png",
|
"icon": "speedo.png",
|
||||||
"version":"0.01",
|
"version":"0.02",
|
||||||
"description": "Show the current speed according to the GPS",
|
"description": "Show the current speed according to the GPS",
|
||||||
"tags": "tool,outdoors,gps",
|
"tags": "tool,outdoors,gps",
|
||||||
"storage": [
|
"storage": [
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,14 @@
|
||||||
|
Bangle.loadWidgets();
|
||||||
Bangle.setGPSPower(1);
|
Bangle.setGPSPower(1);
|
||||||
Bangle.setLCDMode("doublebuffered");
|
Bangle.setLCDMode("doublebuffered");
|
||||||
var lastFix = {fix:0,satellites:0};
|
var lastFix = {fix:0,satellites:0};
|
||||||
function onGPS(fix) {
|
function onGPS(fix) {
|
||||||
lastFix = fix;
|
lastFix = fix;
|
||||||
g.clear();
|
g.clear();
|
||||||
|
Bangle.drawWidgets();
|
||||||
g.setFontAlign(0,0);
|
g.setFontAlign(0,0);
|
||||||
g.setFont("6x8");
|
g.setFont("6x8");
|
||||||
g.drawString(fix.satellites+" satellites",120,6);
|
g.drawString(fix.satellites+" satellites",120,36);
|
||||||
if (fix.fix) {
|
if (fix.fix) {
|
||||||
var txt = (fix.speed<20) ? fix.speed.toFixed(1) : Math.round(fix.speed);
|
var txt = (fix.speed<20) ? fix.speed.toFixed(1) : Math.round(fix.speed);
|
||||||
var s = 80;
|
var s = 80;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue