Created
December 9, 2014 06:41
-
-
Save neoneo40/b88f60df91a17438b0f0 to your computer and use it in GitHub Desktop.
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
int before_sw = HIGH; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(9, INPUT_PULLUP); | |
pinMode(13, OUTPUT); | |
} | |
void loop() { | |
if(digitalRead(9) == LOW && before_sw == HIGH) | |
{ | |
before_sw = LOW; | |
if(digitalRead(13) == HIGH) digitalWrite(13, LOW); | |
else digitalWrite(13, HIGH); | |
} | |
else if(digitalRead(9) == HIGH) | |
{ | |
before_sw = HIGH; | |
} | |
// delay(100); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment