int xValue = 0 ; // read value of the X axis int yValue = 0 ; // read value of the Y axis int sValue = 0 ; // value of the button reading void setup() { Serial.begin(9600) ; pinMode(17,INPUT) ; // Configure Switch as an input digitalWrite(17,HIGH); } void loop() { // Read analog port values from the pins 18 and 19 xValue = analogRead(18); yValue = analogRead(19); sValue = digitalRead(17); // Read the logic value on Switch // We display our data separated by a comma Serial.print(xValue,DEC); Serial.print(","); Serial.print(yValue,DEC); Serial.print(","); Serial.print(!sValue); // We end with a newline character to facilitate subsequent analysis Serial.print("\n"); delay(100); }