All tutorials

3 · Outputs & actuators

Servo driven by a potentiometer

Intermediate15 min

Goal

Make the servo arm follow the knob position.

Why it matters

Your first direct input → output control, the basis of robotics.

Steps

  1. 01Read A0.
  2. 02map(value, 0, 1023, 0, 180).
  3. 03Apply the angle to the servo, with a short delay.

This tutorial runs inside the Circuitly simulator: your wiring and your code are checked automatically at every step.

Next tutorials