PyRaspBeta

← All practice problems

Raspberry Pi practice problem · Projects

Pet feeder

EasyBudget $8Python · gpiozero

A pet feeder: a button on GPIO27 and a servo flap on GPIO18 (power it from 5 V; 0.5 ms pulse = 0°, 2.4 ms = 180°).

The flap is closed at 0°. Each press opens it to 90° for 1.5 s, then closes it again. The test presses at 1 s and 4 s.

Tip: gpiozero.AngularServo(18, min_angle=0, max_angle=180, min_pulse_width=0.0005, max_pulse_width=0.0024).

More in Projects