void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(26, INPUT);
pinMode(19, OUTPUT);
pinMode(4, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
int reading = digitalRead(26);
Serial.println(reading);
if(reading==1){
digitalWrite(19, HIGH);
digitalWrite(4, LOW);
}else{
digitalWrite(4,HIGH);
digitalWrite(19, LOW);
}
}