Hey guys,
I just bought a IMU 5DOF sensor, and when i run the program
int x=0;
int y=1;
int z=2;
void setup()
{
Serial.begin(9600); // sets the serial port to 9600
}
void loop()
{
x = analogRead(0); // read analog input pin 0
y = analogRead(1); // read analog input pin 1
z = analogRead(2);
Serial.print("accelerations are x, y: ");
Serial.print(x, DEC); // print the acceleration in the X axis
Serial.print(" "); // prints a space between the numbers
Serial.print(y, DEC);
Serial.print(" "); // prints a space between the numbers
Serial.println(z, DEC);
delay(100); // wait 100ms for next reading
}
i get the foll: output that doesnt change even though i tilt or move the sensor
accelerations are x, y, z : 103 105 106
accelerations are x, y, z : 103 105 106
accelerations are x, y, z : 103 105 106
accelerations are x, y, z : 103 105 106
etc
(I use an old version of arduino , so i used a voltage divider network of 12K and 20K resistors to get 3.3V from 5 V)
Please help, what would be wrong??