Skip to content

Instantly share code, notes, and snippets.

@IowaDave
Created June 21, 2018 20:48
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 IowaDave/c56413145f9091a8b3f198da5f9e9945 to your computer and use it in GitHub Desktop.
Save IowaDave/c56413145f9091a8b3f198da5f9e9945 to your computer and use it in GitHub Desktop.
Push Button Example for HyperDuino
/*************************************************
* Push_Button | HyperDuino example Code
*
* To demonstrate use of the HyperDuino with the
* 37 Sensors kit by Elegoo.
*
* Target: Arduino IDE and compatible editors
*
* by David Sparks June 21, 2018
**************************************************/
// Declarations
int buttonState = LOW;
void setup() {
// put your setup code here, to run once:
pinMode(8, INPUT);
pinMode(13, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
buttonState = digitalRead(8);
if (buttonState == HIGH) {
digitalWrite(13, LOW);
} else {
digitalWrite(13, HIGH);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment