Last active
October 15, 2019 05:28
-
-
Save MargenauMaker/06dffc5370fe9a616a0eb2001d41e469 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Basic if else example for Lilymini | |
*written by B. Elliott Oct 15, 2019 | |
*/ | |
int switchState = 0; | |
void setup() { | |
pinMode (7, OUTPUT); | |
pinMode (5, OUTPUT); | |
pinMode (4, OUTPUT); | |
pinMode (2, INPUT); | |
} | |
void loop() { | |
switchState = digitalRead(2); | |
if (switchState == LOW){ | |
digitalWrite (4, HIGH); | |
digitalWrite (5,LOW); | |
digitalWrite (7,LOW); | |
} | |
else{ | |
digitalWrite (4, LOW); | |
digitalWrite (5,HIGH); | |
digitalWrite (7,HIGH); | |
delay (250); | |
digitalWrite (4, HIGH); | |
digitalWrite (5,LOW); | |
digitalWrite (7,LOW); | |
delay(250); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment