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