SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By third_meow
#193477
I've got a Redbot with shadow chassis and am following the tutorial .

Part 8 deals with the accelerometer (https://learn.sparkfun.com/tutorials/ex ... elerometer).

I would like to extend what's shown there so that I could write a program which would use the accelerometer readings to know when the bot has turned, say, 90 right.

I have written a program to output the values from the accelerometer. I know that the X-Z, Y-Z, X-Y provide representations of the angular movements but what I don't understand what those representations are.

The script itself is here : http://pastebin.com/fD8a2FD3 .

Here's my output from a script which drives the bot 90 degrees right : http://imgur.com/a/gnwSY .

I've run the X-Y numbers through an inverse SIN, TAN and COS but nothing looks anything like a 90 degree turn .

Would really appreciate some advice / pointers on how I can interact with the accelerometer at a higher level than the raw output .

Thanks.