PyRaspBeta

← All practice problems

Raspberry Pi practice problem · Motors & actuators

Hold to pump

EasyBudget $24Python · gpiozero

A water pump behind a relay whose input is on GPIO26 (the shop's relay + pump kit: VCC to 5 V, GND to ground, SIG to the GPIO), and a push button on GPIO27. The pump runs only while the button is held.

The test holds the button from 1 s to 2.5 s and from 3.5 s to 4 s.

More in Motors & actuators