Re: Memsic 2125 code?
Calculating degrees from an accelerometer is rather involved. You need some trig functions. Looks like these guys did it with ArcCosine and ArcSine http://www.parallax.com/dl/docs/prod/acc/memsickit.pdf . Or it could be done with ArcTan: http://www.picbasic.co.uk/forum/cont...-axis-g-sensor (different sensor, but tilt degree math will work on any sensor)
This gentleman used the Memsic 2125 sensor, and his code might be a little easier, with less resolution. Check out his tilt code in the middle of his code at GetSensors:
http://www.picbasic.co.uk/forum/cont...-(open-source)
http://www.scalerobotics.com
Bookmarks