accelOff should definitely work! What if you just try something simple like:
Puck.on('accel', function(data) { digitalPulse(LED1,1,10); });
Puck.accelOn();
// LED should blink
// Now run Puck.accelOff()
What you've got there definitely all seems ok to me. What I can see though is you're using connected but don't seem to be defining it anywhere, so when accelerometerEnabled is false, line 48 will probably cause an error, and that could be causing some issues for you?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi - is your Puck firmware up to date (2v08)?
accelOff
should definitely work! What if you just try something simple like:What you've got there definitely all seems ok to me. What I can see though is you're using
connected
but don't seem to be defining it anywhere, so whenaccelerometerEnabled
is false, line 48 will probably cause an error, and that could be causing some issues for you?