int xPin=A0;
int yPin=A1;
int switchPin=2;
int xVal;
int yVal;
int switchVal;
String msg1="The value across X is ";
String msg2=" , the value across Y is ";
String msg3=" and the state of the switch is ";
int delayTime=500;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(xPin,INPUT);
pinMode(yPin,INPUT);
pinMode(switchPin,INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
xVal=analogRead(xPin);
yVal=analogRead(yPin);
switchVal=digitalRead(switchPin);
Serial.print(msg1);
Serial.print(xVal);
Serial.print(msg2);
Serial.print(yVal);
Serial.print(msg3);
Serial.println(switchVal);
delay(delayTime);
}