Created
October 11, 2017 12:31
-
-
Save ljahier/a5a4ae03af240b07a119c1af69638d14 to your computer and use it in GitHub Desktop.
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 buttonPin1 = 8; | |
int buttonPin2 = 13; | |
void setup() { | |
// put your setup code here, to run once: | |
Serial.begin(9600); | |
pinMode(buttonPin1, INPUT); | |
pinMode(buttonPin2, INPUT); | |
digitalWrite(buttonPin1, 1); | |
digitalWrite(buttonPin2, 1); | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
int button8 = digitalRead(buttonPin1); | |
int button13 = digitalRead(buttonPin2); | |
if (button8 == 0) { | |
Serial.write(1); | |
Serial.flush(); | |
delay(20); | |
} | |
if (button13 == 0) { | |
Serial.write(2); | |
Serial.flush(); | |
delay(20); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment