-
• #2
Hi - is your Puck firmware up to date (2v08)?
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 whenaccelerometerEnabled
is false, line 48 will probably cause an error, and that could be causing some issues for you? -
• #3
OK, found the issue!
It was my misunderstanding of the
repeat
option onsetWatch
... All working now once set totrue
, thank you!
Hi!
I'm working on using Puck 2's accelerometer in order to detect when I'm braking on my bike!
As of yet, I haven't been able to turn off the Accelerometer using
Puck.accelOff()
. Accel reads seem to be blocking my code to turn it off - but I think it's more the case I'm doing something wrong.Here's my code:
No issues with sending the data over BLE to my ESP32 however - works like a charm!
One other thing I wanted to know was how to "normalise" the accel's values, but I'll post that up in another convo.