Hi guys , I have got any mm8452q accelorometer . kinda new to this was hoping some one could guide me on how to get x value to change to an angle value if posible to use to get robot to drive straight .
I got it to work using their code (MMA8452Q Accelerometer Breakout Hookup Guide - SparkFun Learn) just not sure on how to go from here. any help would be appreciate even link that could guide me
With an accelerometer, you can measure pitch and roll following this tutorial.
Unfortunately you cannot measure yaw, which is probably what you had in mind for maintaining a straight course. To measure yaw use a magnetometer. A gyro or wheel encoders also work well to maintain a straight line.
Thank u. I have odered mpu6050 as i see that they can work to for this too, have u got any more link as I am new to this and would like to get a better understanding of how to control dc motor with this utube not really great help with this .
Don't waste your time with the MPU6050. It hasn't been manufactured for years, and you are likely to end up with a reject or clone. And it can't measure yaw either.
Adafruit, Sparkfun and other reputable suppliers carry modern IMU modules. Get a 9DOF one, which has a magnetometer.
All 9DOF modules must be calibrated before they can be used for navigation.