Little Bird Curriculum / code littlebird.com.au
_01_Blink.ino Arduino (C/C++) 10 lines · 8 views ✦ Open in English IDE Raw Download Embed view

Flash the ThinkerShield's D12 LED on for one second, off for one second, forever. The first Arduino sketch.

From the unit Crack the Code · activity PRP 1: Digital output — Blink
void setup() {              // runs once when you press reset or power the board
  pinMode(12, OUTPUT);      // make digital pin 12 an output
}

void loop() {               // runs over and over again, forever
  digitalWrite(12, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for one second (1000 milliseconds)
  digitalWrite(12, LOW);    // turn the LED off (LOW)
  delay(1000);              // wait for one second
}

Embed this snippet

As an iframe:

Or drop it inline with a script tag (injects the highlighted block where included):

Shared from Little Bird Electronics curriculum.

Copied to clipboard