Combine sensor thresholds and motor decisions for line following robots.
Open in compiler →Source code and build tools are available in the protected platform workspace.
How it works
Use two analog sensors to make basic line-following motor decisions.
- Wire left and right sensors to A0 and A1.
- Wire motor driver speed inputs to D5 and D6.
- Tune lineThreshold for the track and sensor height.
- Reduce one side speed when that sensor sees the line.
Connections
| Pin | Connect to | Note |
|---|---|---|
| A0, A1 | IR reflectance sensor outputs | Tune lineThreshold for your surface. |
| D5, D6 | Motor driver speed inputs | Use separate motor power and common GND. |