Skip to content

Instantly share code, notes, and snippets.

@jargnar
Last active May 6, 2018 12:18
Show Gist options
  • Save jargnar/1a71cc9ce47865b24878753707a1b157 to your computer and use it in GitHub Desktop.
Save jargnar/1a71cc9ce47865b24878753707a1b157 to your computer and use it in GitHub Desktop.
Hello Arduino
#define BUTTON 5
#define LED 8
void setup()
{
Serial.begin(9600);
pinMode(LED, OUTPUT);
pinMode(BUTTON, INPUT_PULLUP);
Serial.println("Hello, Arduino");
}
void loop()
{
if (digitalRead(BUTTON) == LOW) {
digitalWrite(LED, HIGH);
delay(20);
digitalWrite(LED, LOW);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment