PyRaspBeta

← All practice problems

Raspberry Pi practice problem · Motors & actuators

Wave hello

EasyBudget $8Python · gpiozero

A servo with its signal on GPIO18 waves hello: 60° for 0.5 s, then 120° for 0.5 s, over and over, starting at 60°.

Power the servo from 5 V; it takes 0.5 ms pulses for 0° and 2.4 ms for 180° (AngularServo(…, min_pulse_width=0.0005, max_pulse_width=0.0024)).

Tip: the servo turns at about 600 °/s, so each 60° swing takes a tenth of a second.

More in Motors & actuators