Skip to content

Instantly share code, notes, and snippets.

@komponenrobot
Created March 28, 2020 20:18
Show Gist options
  • Save komponenrobot/df5ac68f53f355916f215911c15a1718 to your computer and use it in GitHub Desktop.
Save komponenrobot/df5ac68f53f355916f215911c15a1718 to your computer and use it in GitHub Desktop.
led_prot
void setup() {
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(2, INPUT_PULLUP);
}
void loop() {
if(digitalRead(2) == LOW){
digitalWrite(12, HIGH);
digitalWrite(11, HIGH);
}
else {
digitalWrite(12, LOW);
digitalWrite(11, LOW);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment