Skip to content

Instantly share code, notes, and snippets.

/Lab4.ino Secret

Created February 8, 2017 23:20
Show Gist options
  • Save anonymous/b6013561e8a84c35648f39f8ea755ceb to your computer and use it in GitHub Desktop.
Save anonymous/b6013561e8a84c35648f39f8ea755ceb to your computer and use it in GitHub Desktop.
Lab 4
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