The plug story continues…
The Gravity Plug contains a 3-axis accelerometer with 2..8g settable range:
As before, a new GravityPlug class has been added to the Ports library, along with a “gravity_demo” sketch to illustrate its use:
Sample output:
Values are X, Y, and Z, in that order.
I’m not sure about the high bit readout with the current code, maybe this needs some tweaking to get the ranges right, but you can see the effect of moving the plug around a bit.
The Y axis wraparound may be due to the chip not being completely flat on the board. This is a minute chip, which can’t be soldered by hand because the pads are too small and on the bottom side of the chip. I applied solder paste manually and then used the reflow grill – but even that is tricky, it’s very difficult to get an even-yet-small amount of paste on there! A solder paste stencil will no doubt solve this.
Ah! And I just forked out for MMA7260Q AND a nunchuck :(
Will be grabbing one of these anyways :)