Update app.js
parent
1311ed4fb3
commit
24fe023364
|
|
@ -3,9 +3,10 @@ Speed and Altitude [speedalt2]
|
||||||
Mike Bennett mike[at]kereru.com
|
Mike Bennett mike[at]kereru.com
|
||||||
0.01 : Initial
|
0.01 : Initial
|
||||||
0.06 : Add Posn screen
|
0.06 : Add Posn screen
|
||||||
0.07 : Add swipe to change screens
|
0.07 : Add swipe to change screens same as BTN3
|
||||||
|
0.08 : Add dbl tap on front same as short BTN1
|
||||||
*/
|
*/
|
||||||
var v = '0.07b';
|
var v = '0.07c';
|
||||||
|
|
||||||
/*kalmanjs, Wouter Bulten, MIT, https://github.com/wouterbulten/kalmanjs */
|
/*kalmanjs, Wouter Bulten, MIT, https://github.com/wouterbulten/kalmanjs */
|
||||||
var KalmanFilter = (function () {
|
var KalmanFilter = (function () {
|
||||||
|
|
@ -524,12 +525,8 @@ function nextScrn() {
|
||||||
onGPS(lf);
|
onGPS(lf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Next function on a screen
|
||||||
function setButtons(){
|
nextFunc(dur) {
|
||||||
|
|
||||||
// BTN1 - Max speed/alt or next waypoint
|
|
||||||
setWatch(function(e) {
|
|
||||||
var dur = e.time - e.lastTime;
|
|
||||||
if ( cfg.modeA == 0 || cfg.modeA == 1 ) {
|
if ( cfg.modeA == 0 || cfg.modeA == 1 ) {
|
||||||
// Spd+Alt mode - Switch between fix and MAX
|
// Spd+Alt mode - Switch between fix and MAX
|
||||||
if ( dur < 2 ) showMax = !showMax; // Short press toggle fix/max display
|
if ( dur < 2 ) showMax = !showMax; // Short press toggle fix/max display
|
||||||
|
|
@ -537,6 +534,14 @@ function setButtons(){
|
||||||
}
|
}
|
||||||
else if ( cfg.modeA == 2) nxtWp(1); // Dist mode - Select next waypoint
|
else if ( cfg.modeA == 2) nxtWp(1); // Dist mode - Select next waypoint
|
||||||
onGPS(lf);
|
onGPS(lf);
|
||||||
|
}
|
||||||
|
|
||||||
|
function setButtons(){
|
||||||
|
|
||||||
|
// BTN1 - Max speed/alt or next waypoint
|
||||||
|
setWatch(function(e) {
|
||||||
|
var dur = e.time - e.lastTime;
|
||||||
|
nextFunc(dur);
|
||||||
}, BTN1, { edge:"falling",repeat:true});
|
}, BTN1, { edge:"falling",repeat:true});
|
||||||
|
|
||||||
// Power saving on/off
|
// Power saving on/off
|
||||||
|
|
@ -661,6 +666,20 @@ Bangle.on('swipe',function(dir) {
|
||||||
else nextScrn();
|
else nextScrn();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
dir : "left/right/top/bottom/front/back",
|
||||||
|
double : true/false // was this a double-tap?
|
||||||
|
x : -2 .. 2, // the axis of the tap
|
||||||
|
y : -2 .. 2, // the axis of the tap
|
||||||
|
z : -2 .. 2 // the axis of the tap
|
||||||
|
*/
|
||||||
|
|
||||||
|
Bangle.on('tap',function(tap) {
|
||||||
|
if ( tap.dir == 'front' && tap.double ) nextFunc(1); // Same as short BTN1
|
||||||
|
});
|
||||||
|
|
||||||
|
//nextFunc(dur)
|
||||||
|
|
||||||
var gpssetup;
|
var gpssetup;
|
||||||
try {
|
try {
|
||||||
gpssetup = require("gpssetup");
|
gpssetup = require("gpssetup");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue