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