Created
March 23, 2016 10:28
-
-
Save fauria/b88d50ffe6d4bdfd7fe4 to your computer and use it in GitHub Desktop.
Sample code for the Grove Protoshield Dual SPDT Switch
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
// Plugged to socket D4 | |
int leftSwitch = 4; | |
int rightSwitch = 5; | |
void setup() { | |
Serial.begin(9600); | |
} | |
void loop() { | |
String switchStatus = (String)digitalRead(leftSwitch)+(String)digitalRead(rightSwitch); | |
Serial.println("Switch status: "+switchStatus+"\n"); | |
delay(1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment