void setup() {
// put your setup code here, to run once:
pinMode(2, INPUT);
pinMode(3, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
int x = digitalRead(2);
if (x==0){
digitalWrite(3, HIGH);
digitalWrite(3, LOW);
}
else{
digitalWrite(2, LOW);
}
}