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 STM32's full ADC: 0.8 mV per step.
Read the blue B1 button on PC13 and a potentiometer on A0 with the full 12-bit ADC, and print both over the ST-LINK's virtual COM port. LD2 lights while you hold B1.
| Pin | Connects to | What it does |
|---|---|---|
PC13 | B1 on the board (no wire needed) | Input with R30's 4.7 kΩ pull-up: LOW while pressed. |
A0 | The knob's middle leg (wiper) | ADC input, 0 to 3.3 V. |
3V3 | One end of the knob | The top of the knob's range: 3.3 V, never 5 V. |
GND | The knob's other end | The bottom of the range. |
Sensors and actuators this board drives, with the real connections.
Ends to GND and 3V3, wiper to A0: analogRead() gives 0-4095 after analogReadResolution(12).
| Part pin | Board pin |
|---|---|
| 1 | GNDWire colour black |
| W | A0Wire colour yellow |
| 3 | 3V3Wire colour red |
Power it from 3V3, never 5V: an ADC input in analog mode takes 4.0 V at most, and reads 4095 for anything above 3.3 V.