PyRaspBeta

← All practice problems

Raspberry Pi practice problem · Motors & actuators

Wind back

EasyBudget $12Python · gpiozero

A 28BYJ-48 stepper on its ULN2003 board: IN1–IN4 on GPIO17, 18, 27, 22, powered from 5 V. Half-step sequence (IN1..IN4): 1000, 1100, 0100, 0110, 0010, 0011, 0001, 1001 — walking it forwards turns the shaft clockwise (increasing angle). 4076 half-steps make one output turn; from rest, keep to at most one half-step every 2 ms.

Turn the output shaft 45° anticlockwise — walk the sequence backwards — then stop. 45° is one eighth of a turn: 510 half-steps.

More in Motors & actuators