Here is the code I am using,
int yAxisValue = 0; // value read from the accelerometer's y-axis
int prevY = 1023;void setup()
{
// initialize serial communications at 9600 bps
Serial.begin(9600);
}void loop()
{
// read the joystick x-axis values:
yAxisValue = accelerometer.getYAxis();if (prevY != yAxisValue) {
// print the results to the serial monitor:
Serial.print("Y=");
Serial.println(yAxisValue);//Serial.write(yAxisValue);
prevY = yAxisValue;
}// 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.
TIA