const int tombol1=23;
const int tombol2= 22;
const int led = 13;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(tombol1, INPUT);
pinMode(tombol2, INPUT);
pinMode(led, OUTPUT);
}
void loop() {
int buttonstate1=digitalRead(tombol1);
int buttonstate2=digitalRead(tombol2);
if(buttonstate1==HIGH||buttonstate2==LOW){
digitalWrite(led, HIGH);
}
else{
digitalWrite(led, LOW);
}
Serial.print("led =");Serial.println(digitalRead(13));
// put your main code here, to run repeatedly:
delay(100); // this speeds up the simulation
}