#define s1 23
#define s2 22
#define ph1 21
void setup() {
pinMode(ph1, OUTPUT);
pinMode(s1, INPUT_PULLDOWN);
pinMode(s2, INPUT_PULLDOWN);
}
void loop() {
bool ps1=digitalRead(s1);
bool ps2=digitalRead(s2);
bool h1 = (!ps1 & ps2) | (ps1 & !ps2);
digitalWrite(ph1, !h1);
}