Memsic 2125 in Matlab with Arduino board
jomille
Posts: 2
I have a Memsic 2125 chip hooked up to a Arduino board that is reporting raw acceleration data back to Matlab. Using the code here (http://arduino.cc/en/Tutorial/Memsic2125?from=Tutorial.AccelerometerMemsic2125) I read the accelerationX and accelerationY in Matlab via the serial port. Now I need to convert this into an actual degree angle for X and Y. Using the data I am getting from the board in acceleration, how can I convert this into an angle?
Thanks
Thanks
Comments
Article - http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/vol3/col/nv92.pdf
Code - http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/vol3/code/nv92.zip
But converting a linear range to an angle is fairly straightforward. If you have a 1000 unit range through 180 degrees then 180/1000 = 0.18 units per degree. Or [step = pi/units]; therefore
f(x) = (sin(x*step) + 1) * offset
If it's not linear than you need to a conversion factor.
Edit: read the article in whit's post. It has the conversion information.