Log in

View Full Version : Acceleromter: totally Hopeless


paulcd2000
20-01-2008, 11:02
Yeah, I've never used the accelerometer before and i have no idea how to code it. I tried to search for other threads, but most had very specific questions. Is there any code by kevin watson designed for use with the accelerometer, or should i somehow alter the gyro code. Any help would be greatly appreciated.

CyDrive
20-01-2008, 13:31
The accelerometer is very similar to the gyro. First you would want to calculate a bias like the gyro has. Then use ADC to grab the input from the analog input and minus the bias from it. This way you get a variable containing no background noise. Well almost no background noise. Now the number you get is returned in milivolts. 1000mv = 1g. There is code on chiefdelphi that has most of these functions already done. Use the search feature.

paulcd2000
20-01-2008, 13:40
ok i found some. if anyone reading needs some code, this is what i found:http://www.chiefdelphi.com/forums/showpost.php?p=547382&postcount=5

EDIT: to complie, include the files, and comment out:
#include "ifi_aliases.h"
#include "ifi_default.h"