# Stepper Motor - Half Stepping from time import sleep_ms from machine import Pin PA = Pin(16,Pin.OUT) PB = Pin(17,Pin.OUT) PC = Pin(18,Pin.OUT) PD = Pin(19,Pin.OUT) TABLE = [1, 3, 2, 6, 4, 12, 8, 9] def Step(X): Y = TABLE[X % 8] PA.value( Y & 8 ) PB.value( Y & 4 ) PC.value( Y & 2 ) PD.value( Y & 1 ) x = 0 for i in range(0,200): x += 1 Step(x) sleep_ms(10)