Created
May 21, 2015 06:05
-
-
Save t-kashima/f58333da3215480efa9d to your computer and use it in GitHub Desktop.
LED Input/Output for Arduino
This file contains hidden or 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
bool isHigh = true; | |
void setup() { | |
// put your setup code here, to run once: | |
Serial.begin(9600); | |
pinMode(12, OUTPUT); | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
isHigh = !isHigh; | |
digitalWrite(12, isHigh ? HIGH : LOW); | |
int response = digitalRead(12); | |
Serial.println(response); | |
delay(1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment