Sample potentiometers, light sensors, thermistors, and analog robot signals.
Open in compiler →Source code and build tools are available in the protected platform workspace.
How it works
Read a variable analog voltage and compare it with a threshold.
- Connect the sensor output to the listed analog pin.
- Connect sensor VCC and GND to the board.
- Open Serial Monitor to see raw 0-1023 values on AVR boards.
- Adjust threshold for your sensor range.
Connections
| Pin | Connect to | Note |
|---|---|---|
| A2 | Potentiometer wiper, LDR divider, thermistor divider, or analog sensor output | Use the same board ground as the sensor. |
| D13 | Built-in LED | Turns on when the analog value crosses the threshold. |