Skip to content

Instantly share code, notes, and snippets.

@einarpersson
Last active November 13, 2020 09:12
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 einarpersson/093594485e8e878547bc54035e5d1999 to your computer and use it in GitHub Desktop.
Save einarpersson/093594485e8e878547bc54035e5d1999 to your computer and use it in GitHub Desktop.
Sample of Arduino code for lesson 2020-11-13
int duration = 200;
int blueLedPin = LED_BUILTIN;
int count = 0;
void blink() {
digitalWrite(blueLedPin, HIGH);
delay(duration);
digitalWrite(blueLedPin, LOW);
delay(duration);
}
void setup() {
pinMode(blueLedPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
Serial.print(count);
blink();
delay(2000);
count = count + 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment