void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("switch on/off ") ;
pinMode(32, OUTPUT);
pinMode(34, INPUT) ;
}
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(34)==1)
{
Serial.println("switch is on! ");
digitalWrite(32, HIGH);
}
else{
digitalWrite(32, LOW);
Serial. println("switch is off! ");
}
delay(10); // this speeds up the simulation
}