Blink an LED
One second on, one second off, forever. Where everything starts.
Indicator
ledGPIO
Why this support circuit is added
Status LED.
Grounded in the catalog and golden patterns (real open-source circuits). Every auto-inserted part comes with a reason.
Using this part in a project adds the circuit below, each element with its reason.
Without a series resistor both the LED and the MCU pin overcurrent.
Run them in the browser, no login needed.
One second on, one second off, forever. Where everything starts.
analogWrite walks D13's brightness up and back down forever.
D13 lights only while the button is pressed.
Reads a button with INPUT_PULLUP and no external resistor — pressed reads 0.
A button bounces on contact; waiting 50 ms turns the noise into one press.
Detects the moment a button goes down, not whether it is down.
Times the blink instead of stopping — the shape you need to do two things at once.
The A0 reading is used directly as the delay, so turning it speeds the blink up.
Two for-loops walk the brightness up and back — the same result as Fade, written differently.
Learns the lowest and highest values it sees in the first five seconds, then scales to those.
The higher the reading, the more LEDs light. The simplest way to see a number.
The LED comes on only when the reading crosses a number you chose. if in its simplest form.
A for-loop runs along a row of LEDs and back. This is what loops are for.
Stays inside the while-loop for as long as the button is down.
Sending a–e over serial lights the matching LED.
Lists the LED pins once and walks the list, instead of naming each pin by hand.
D13 lights up while the button is held. Start here.
The darker the light sensor reads, the brighter the LED — the brightness is an analogWrite duty cycle.
A PIR sensor lights the lamp and holds it on for three seconds after the last movement.
An ultrasonic range finder beeps at shorter intervals as something gets closer, and lights an LED inside 30 cm.
Accelerometer samples stream into motion.csv on a microSD; the LED blinks while logging.
The relay closes when the DS18B20 passes 28 °C; an ultrasonic sensor measures distance too.