Hello,
We are making a ferrari like steering wheel:
So you can see the lights in the steering wheel.
What we want to accomplish is that when you turn the steering wheel left for example between 0degrees (middle position) and 20 degrees one light turns on and 20-40 degrees to the left 2 lights turn on on the left side of the wheel.
Whe have hooked up an acclerometer(mma7361 ) to the arduino but unless I move it really fast the values dont really make sense.
I need to just have the angles in degrees as a readout of that sensor:
Right now I have this code:
int x;
int y;
int z;
void setup()
{
Serial.begin(9600);
}
void loop()
{
x = analogRead(A0);
y = analogRead(A1);
z = analogRead(A2);
Serial.print("X = ");
Serial.println(x);
Serial.print("Y = ");
Serial.println(y);
Serial.print("Z = ");
Serial.print(z);
Serial.println("");
Serial.print("______");
delay(1000);
}
But whenever nothing is connected to the arduino the arduino still putts out data.
And when the sensor is connected the values that presumably the sensor putts out into serial monitor are different every second altough I dont move it around and if I move it around slowly not a lot of the values change. When I that putt it back on the table the values arent returning to the values when I started the script.
Is the acclerometer the right option for this and maybe when I can read out degrees it works better but how can I get the raw data into degrees