int xPosPin = 0;
int yPosPin = 1;
int zPosPin = 8;
int xVal, yVal, zVal;
void setup() {
// put your setup code here, to run once:
pinMode(zPosPin, INPUT_PULLUP); // pull-up input (same as INPUT, but puts a high resistance value resistor to VCC behind the port)
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
xVal = analogRead(xPosPin); // read analog value of pin xPin
yVal = analogRead(yPosPin); // read analog value of pin yPin
zVal = digitalRead(zPosPin); // read digital value of zPin
Serial.print("X : ");
Serial.print(xVal);
Serial.print(" \tY : ");
Serial.print(yVal);
Serial.print(" \tZ : ");
Serial.println(zVal);
delay(200); // delay 200 ms
}