void setup() {
Serial.begin(9600);
pinMode(A0, INPUT);
pinMode(A1, INPUT);
pinMode(2, INPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
}
void loop() {
int vert = analogRead(A0);
int horz = analogRead(A1);
bool sel = digitalRead(2);
Serial.print(horz);
Serial.print(",");
Serial.println(vert);
if(vert>512){digitalWrite(3, HIGH);}
else{digitalWrite(3, LOW);}
if(vert<512){digitalWrite(9, HIGH);}
else{digitalWrite(9, LOW);}
if(horz>512){digitalWrite(6, HIGH);}
else{digitalWrite(6, LOW);}
if(horz<512){digitalWrite(7, HIGH);}
else{digitalWrite(7, LOW);}
if(vert>512&&horz>512){digitalWrite(4, HIGH);}
else{digitalWrite(4, LOW);}
if(vert>512&&horz<512){digitalWrite(5, HIGH);}
else{digitalWrite(5, LOW);}
if(vert<512&&horz>512){digitalWrite(8, HIGH);}
else{digitalWrite(8, LOW);}
if(vert<512&&horz<512){digitalWrite(10, HIGH);}
else{digitalWrite(10, LOW);}
}