For control UI and visualization of the behavior I used Espruino IDE's built-in and enabled Testing facility with a sampling rate of 2 samples / sec.
I defined the values to plot:
1. volts - eps.getVolts()
2. on - (eps._isOn) ? 1 : 0
3. fix - gps._fix
4. sats - gps._sats
I defined the switch on and off commands:
1. on - gps.switch(1);
1. off - gps.switch(0);
A convenient click on command buttons switches the GPS on and off.
© Espruino, powered by microcosm.
Report a problem