Skip to content

Instantly share code, notes, and snippets.

@t-kashima
Created May 21, 2015 06:05
Show Gist options
  • Save t-kashima/f58333da3215480efa9d to your computer and use it in GitHub Desktop.
Save t-kashima/f58333da3215480efa9d to your computer and use it in GitHub Desktop.
LED Input/Output for Arduino
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