/*
This sketch is used to derive the max and min calibration values
for the ADXL335 analog accelerometer when used as output device
for an expression pedal.
Connect power and ground and the three inputs as listed below.
Also connect Aref to 3.3V on the Arduino.
Upload the sketch and using the serial monitor observe the outputs of
the three axes as the expression pedal is moved from closed to open.
Decide which axis to use based on the one that has the greatest difference
between the max and min readings. Record those max and min readings and enter
these values into the parallel encoder sketch modified for use of the ADXL335.
*/
const int xInput = A0;
const int yInput = A1;
const int zInput = A2;
void setup()
{
analogReference(EXTERNAL);
Serial.begin(9600);
}
void loop()
{
//Read raw values
int xRaw =analogRead(xInput);
int yRaw =analogRead(yInput);
int zRaw =analogRead(zInput);
Serial.print("X, Y, Z :: ");
Serial.print(xRaw);
Serial.print(", ");
Serial.print(yRaw);
Serial.print(", ");
Serial.println(zRaw);
delay(500);
}