Loading the figure…
Stopped · Your code isn't running yet. Until you press Run, the board runs the program already on it.
Nothing printed yet. Press Run.
Not checked yet
Run your code to check it. The checks replay a fixed script on a virtual clock, so the same code always gets the same result.
Each fault really happens in the simulation. Trigger one, watch the figure, then read why.
Play the world: press, slide and turn the parts while the code runs.
Change a value here or click a chip in the code.
The LED copies the button: on while you press.
An input at last: a push button on D2 decides when the LED on D13 lights. Hold it to light the LED, or switch the code so each press toggles it.
| Pin | Connects to | What it does |
|---|---|---|
5V | One side of the button | Pressing connects it to D2. |
D2 | The other side of the button, and the 10 kΩ pull-down | Reads HIGH while pressed, LOW otherwise. |
GND | Pull-down and LED | Holds D2 LOW when the button is up, and returns the LED's current. |
D13 | 220 Ω resistor and the LED | Lights the LED. |
Sensors and actuators this board drives, with the real connections.
Anode (long leg) toward the pin, cathode to GND, with a 220 Ω to 1 kΩ resistor in series.
| Part pin | Board pin |
|---|---|
| A | D13Wire colour orange |
| K | GNDWire colour black |
Never without the resistor: the pin would try to push over 100 mA through the LED.
Between D2 and GND with pinMode(2, INPUT_PULLUP): reads LOW while pressed. With an external pull-down to GND and the button to 5 V it reads HIGH while pressed instead.
| Part pin | Board pin |
|---|---|
| 1 | D2Wire colour blue |
| 3 | GNDWire colour black |