hey guys
(or kingofl337, as you seem to be the only one responding, LOL)
i have a basic code laid out in easyC to convert the acceleration values from the accelerometer into velocity, shown below:
void main ( void )
{
int accelerometery[6] = {0};
int timestep = 1000;
int i = 0;
int velocity[6] = {0};
InitAccelerometer ( 2 ) ; // initializes the accelerometer sensor
Wait ( 1000 ) ;
StartAccelerometer ( 2 ) ; // starts the sensor
while ( 1 )
{
i = i + 1 ;
accelerometery* = GetAcceleration ( 2 ) ; // reads feedback from the sensor
velocity* = accelerometery* * timestep + velocity* ;
PrintToScreen ( "Accelerometery = %d mgs\n" , accelerometery[6] ) ; // displays the acceleration in milig's
PrintToScreen ( "Velocity = %d\n" , velocity[6] ) ;
Wait ( timestep ) ;
}
}
when i run the code to test, and keep the accelerometer absolutely still, i am getting these values:
https://lh3.googleusercontent.com/-SFVIqfudyq4/ToS3QeZZ7DI/AAAAAAAAAFE/0sDf6YWn3zY/s512/jumbo.JPG***
any idea / advice as to what is wrong or what i should fix?
thanks in advance.*