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.
Inputs let the Nano sense the world: a button on D2 that reads LOW when pressed, and a knob on A0 that reads 0 to 1023. The L LED shows the button and the Serial Monitor shows both.
| Pin | Connects to | What it does |
|---|---|---|
D2 | Button | Reads LOW while the button is pressed. |
A0 | Knob wiper | Reads the knob's voltage as 0-1023. |
5V | One end of the knob | The top of the divider. |
GND | Button and the other end of the knob | The bottom of the divider and the button's return. |
Sensors and actuators this board drives, with the real connections.
Between D2 and GND with pinMode(2, INPUT_PULLUP): pressed reads LOW, no resistor needed. D2 is also interrupt INT0.
| Part pin | Board pin |
|---|---|
| 1 | D2Wire colour blue |
| 3 | GNDWire colour black |
A 10 kΩ knob as a voltage divider: ends to GND and 5V, wiper to A0. analogRead gives 0-1023.
| Part pin | Board pin |
|---|---|
| 1 | GNDWire colour black |
| 2 | A0Wire colour yellow |
| 3 | 5VWire colour red |
A light-dependent resistor from 5V to A0 plus a 10 kΩ resistor from A0 to GND: more light, higher reading.
| Part pin | Board pin |
|---|---|
| 1 | 5VWire colour red |
| 2 | A0Wire colour yellow |