-
• #2
Nice - thanks!
I believe the callback is called whenever the IRQ line is asserted by the accelerometer/gyro - normally accelOn would then configure the accelerometer for the correct interval (which seems to work ok?) but if you configure the accelerometer for something different with
accelWr
then that may have an effect.When I run your code with the commented out bit uncommented it reports 104 callbacks/sec, so I guess maybe you'd configured the accelerometer some other way while developing? Probably if you just pull the battery and re-add it then run your code again, it'll go back to 104 samples/sec
-
• #3
Ah yes, works as expected after a power cycle. I thought I'd only been setting that 0x11 register for full scale modes as shown in the code but it's possible I poked something else at some point.
Here's a fun way to visualize live gyro data for the z axis - especially fun to roll the puck along a desk! Also fascinating to swing it around fast and film it in slow motion, shows a really nice fast response.
Gyro is quite power hungry so you can tap the puck to toggle it on and off.
@Gordon - I did notice the callback seems to be called frequently (about 280 times / sec), regardless of the rate passed in to accelOn() - bug?