-
-
Save anonymous/b6013561e8a84c35648f39f8ea755ceb to your computer and use it in GitHub Desktop.
Lab 4
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
int ledPin = 4; | |
int ledPinTwo = 6; | |
int inPin = 2; | |
void setup() { | |
// put your setup code here, to run once: | |
pinMode(ledPin, OUTPUT); | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
if (digitalRead(inPin) == LOW) { | |
digitalWrite(ledPin, HIGH); // sets red the LED on | |
digitalWrite(ledPinTwo, LOW); // sets the yellow LED off | |
} else { | |
digitalWrite(ledPin, LOW); // sets red the LED off | |
digitalWrite(ledPinTwo, HIGH); } // sets the yellow LED on | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment