PyRaspBeta

← All practice problems

Raspberry Pi practice problem · Motors & actuators

Reverse gear

EasyBudget $16Python · gpiozero

A DC motor on an L298N driver: IN1 GPIO5, IN2 GPIO6, ENA GPIO12. Run it backwards (IN2 is the driving side) at 70 % speed — about −70 rpm — and keep it running.

Feed the driver's +12V and +5V terminals from the Pi's 5 V and join the grounds. On 5 V the bridge leaves the motor about 3 V: roughly 100 rpm at full speed, proportional to the PWM duty.

gpiozero.Motor(forward=5, backward=6, enable=12) has backward(speed). It must never turn forwards.

More in Motors & actuators