I am trying to use the Tinkerkit Accelerometer with my Arduino board and am able to successfully read the values of X and Y axis from it, but am having trouble wrapping my head around what these values mean.
What do the changes in X and Y values mean? Which is the X axis and Y Axis from a real world view? Any help greatly appreciated.
X and Y are relative.
If the device is on a flat, horizontal surface, conventionally (Cartesian coordinate system) x positive is to the right, x negative is to the left, y positive is forwards (away from the observer), and y negative is backwards (towards the observer)
// wait 50 milliseconds before the next loop
// for the analog-to-digital converter to settle
// after the last reading:
delay(50);
}
The results I see on the serial monitor are Y=3xx range numbers (from 310 to 350 etc.), BTW, could someone please let me know how I may capture the output from the /dev/tty.. device to a file.
BTW, I am trying to use this accelerometer for a simple game 'Ping Pong' to move the paddle on the screen, but am beginning to wonder if an accelerometer should be used here in the first place? Can accelerometer values be used to represent movement?
Remember that a body at constant velocity is not accelerating, so you can't tell if your device is stationary or moving at 100 kmh-1; you can only detect changes of velocity.
AWOL:
Remember that a body at constant velocity is not accelerating, so you can't tell if your device is stationary or moving at 100 kmh-1; you can only detect changes of velocity.
What about if it's changing direction but maintaining velocity?
You can only determine the angle at which the accelerometer is in relation to the vertical if it is not accelerating in a horizontal plane. The the acceleration you read from the X and Y sensors should be:
g * sin(phi)
where g is the acceleration due to gravity (about 9.81ms^-2) and phi is the angle by which the axis you are reading (X or Y) is off the horizontal.