TINKER PiEDESIGN IN INDIA

Blink an LEDTinkerPieCircuit tutorial 8 of 24 · Beginner · 10 minutes

Wire one LED and a resistor to the TinkerPie board and make it blink, the "hello world" of electronics.

Open this circuit in TinkerPieCircuit (free, runs in your browser)

What you will learn

Parts

TinkerPie V1 board1 LED (any colour)1 resistor, 220 Ω

Steps

  1. Add the parts

    Click Resistor and then LED in the Parts list. Keep the resistor at 220 Ω (select it to change the value).

  2. Wire the signal

    Drag from pin S1 on the board to one end of the resistor. Drag from the other end of the resistor to the leg marked + of the LED.

  3. Close the loop

    Drag from the other leg (−) of the LED to the GND pin of the board. Electricity needs a full loop to flow.

  4. Write the code

    Open the Code tab. pinMode(S1, OUTPUT) makes S1 a power pin. digitalWrite(S1, HIGH) turns it on and delay(500) waits half a second.

  5. Press Start

    Press ▶ Start. The LED glows and fades every half second. Press ■ Stop to finish.

The code

function setup() {
  pinMode(S1, OUTPUT);
}

function loop() {
  digitalWrite(S1, HIGH);
  delay(500);
  digitalWrite(S1, LOW);
  delay(500);
}

Copy this into the Code tab. It is Arduino-style JavaScript. The real board uses the same pin names (S1, P10…) in TinkerPie Studio.

How it works

HIGH on a pin means 3.3 V. Current flows from S1, through the resistor and LED, and back to GND. The resistor limits the current so the LED is safe.

Challenge: Make the LED blink twice as fast. Then make it blink in the pattern on-short, on-long (Morse code for "A").

← RGB colour mixer · All 24 circuit tutorials · Button controls an LED →