void setup() {
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(34, INPUT_PULLDOWN);
pinMode(35, INPUT_PULLDOWN);
pinMode(4, OUTPUT);
Serial.begin(9600);
}
void loop() {
int suisHijau = digitalRead(34);
int suisMerah = digitalRead(35);
if(suisHijau == 1)
{
Serial.print("Suis Hijau = "); Serial.println(suisHijau);
digitalWrite(4, HIGH);
delay(500);
}
if (suisMerah == 1)
{
digitalWrite(4, LOW);
delay(500);
}
//Serial.println(analogRead(25));
}