Standard LED
Wire a single-colour LED to a pin and switch it on and off from a sequence.
An LED is the simplest output you can wire to an Arduino. The Standard LED block switches one pin on or off, so the LED lights or goes dark. It works in the browser simulator, over USB direct and through the ArduinoStudio Bridge, and you don’t need a board to start.
Over USB direct the LED is only on or off. Dimming a real LED with Brightness needs the ArduinoStudio Bridge desktop app and a PWM (~) pin.
Wiring
| From | Through | To | Note |
|---|---|---|---|
| Arduino pin 13 | 220 Ω resistor | LED long leg (anode) | Pin 13 also drives the on-board L LED |
| Arduino GND | — | LED short leg (cathode) |
The long leg goes toward the pin, through the resistor. The short leg, next to the flat edge of the rim, goes to GND. Pin 13 also drives the Uno’s on-board L LED, so both light together. That gives you a built-in check.
Block settings
| Setting | New block starts at | In the settings panel |
|---|---|---|
| Digital pin | 13 | Editable |
| Off/On | off | Editable |
| Brightness | 100% | Only on a PWM (~) pin |
| Mode | static | Coming soon |
| Interval | 500 ms | Coming soon |
| Color | — | Editable |
Step by step
- Wire the LED
Connect pin 13 to a 220 Ω resistor, the resistor to the LED’s long leg, and the short leg to GND. No board yet? Skip this step. Steps 2 to 6 run in the browser simulator.
- Add the block
Click + on the sequence, open the Components tab, open LED and choose Standard. Digital pin is already 13.
- Switch it on
Open the block’s settings and turn Off/On on. New blocks start off, and the other settings only appear once it’s on. On pin 13, Brightness is greyed out (“Requires a PWM pin”), and Mode and Interval say “Coming soon”. Leave them and press Save.
- Add a wait
Open the Actions tab, add Wait and set Time to 3000 ms.
- Add a second LED block
Add another Standard block. Leave Digital pin at 13 and Off/On at off, its default.
- Try it in the simulator
Press Play with no board connected. The Virtual Board lists pin 13 as OUTPUT at 1 for three seconds, then 0. The blocks read ON, then OFF.
- Run it on the board
Plug in the Uno and click USB direct in the toolbar. In Connect to hardware, press Connect on the USB direct row and pick the board in the browser’s port list. If the app says the board needs Firmata, let it install it. Press Play: the breadboard LED and the on-board L LED light for three seconds, then go out.
- Make it repeat
Add a Wait after the second block and tick Infinity Loop on the sequence. The blink an LED tutorial walks through that step by step.
Mini-project: Traffic light
Three LEDs and a few Wait blocks make a working traffic light. Wire green, yellow and red LEDs to pins 11, 12 and 13, each through its own 220 Ω resistor, with every short leg to GND. For more ideas like this, see Arduino project ideas.
| From | Through | To |
|---|---|---|
| Arduino pin 11 | 220 Ω resistor | Green LED long leg (anode) |
| Arduino pin 12 | 220 Ω resistor | Yellow LED long leg (anode) |
| Arduino pin 13 | 220 Ω resistor | Red LED long leg (anode) |
| Arduino GND | — | Green LED short leg (cathode) |
| Arduino GND | — | Yellow LED short leg (cathode) |
| Arduino GND | — | Red LED short leg (cathode) |
- Go green
In one sequence, add a Standard LED on pin 11 set to on, then Wait 4000 ms.
- Change to yellow
Add pin 11 off, pin 12 on, then Wait 1000 ms.
- Change to red
Add pin 12 off, pin 13 on, then Wait 4000 ms.
- Loop it
Add pin 13 off, tick Infinity Loop on the sequence, and press Play.
The project uses only Off/On and Wait, so it behaves the same in the simulator, over USB direct and through the Bridge. Stretch goal: run the same cycle on one RGB LED, which needs the Bridge on a real board.
Questions
Why is the Brightness slider greyed out?
Brightness only unlocks on a PWM pin, marked ~. On an Uno or Nano those are 3, 5, 6, 9, 10 and 11, and pin 13 is not one of them. Move the LED and the block’s Digital pin to a ~ pin. Even then, over USB direct the LED is only fully on or fully off. The simulator shows the dimmed value, and the ArduinoStudio Bridge desktop app dims a real LED.
Why can’t I change Mode or Interval?
Both are marked Coming soon in the settings panel, so the LED is simply on or off. If a project built by the AI assistant shows another Mode, such as blink, only the Bridge animates it. Over USB direct and in the simulator that LED is just on. To blink on every connection, alternate Standard LED blocks set on and off with Wait blocks.
Which resistor should I use with a 5 mm LED?
220 Ω is a safe default for a red, green or yellow LED on a 5 V Arduino, about 13 mA. 330 Ω is a little dimmer. Never wire an LED from a pin to GND without a resistor: it can damage both the LED and the pin.
The on-board LED lights but mine stays dark. What’s wrong?
Usually the LED is in backwards. The long leg goes toward the pin through the resistor, and the short leg, next to the flat edge of the rim, goes to GND. Also check that the block’s Digital pin matches the pin you wired, and that the resistor and LED share a breadboard row.
What does the Color setting do?
It colours a small dot on the block in the editor while the LED is on, so you can tell LEDs apart. It is not sent to the board: a single-colour LED always shows its own colour. Changing it also recolours other LED blocks on the same pin. For mixed colours, use an RGB LED, which needs the Bridge on a real board.