Skip to content

Instantly share code, notes, and snippets.

@fauria
Created March 23, 2016 10:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fauria/b88d50ffe6d4bdfd7fe4 to your computer and use it in GitHub Desktop.
Save fauria/b88d50ffe6d4bdfd7fe4 to your computer and use it in GitHub Desktop.
Sample code for the Grove Protoshield Dual SPDT Switch
// 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