Micropython stepper motor driver on ULN2003
Go to file
yousseftechdev bc7ca57d58 updated README.MD, Demo and Stepper.py 2025-03-14 14:22:48 +02:00
img upload v1.0 2018-12-18 15:50:06 +08:00
README.MD updated README.MD, Demo and Stepper.py 2025-03-14 14:22:48 +02:00
Stepper.py updated README.MD, Demo and Stepper.py 2025-03-14 14:22:48 +02:00
boot.py updated README.MD, Demo and Stepper.py 2025-03-14 14:22:48 +02:00
main.py updated README.MD, Demo and Stepper.py 2025-03-14 14:22:48 +02:00

README.MD

ULN2003 for ESP32

uln2003 for MicroPython has been in github, here's the link. But it's work for microbit, so I change a little to transplant for my NodeMCU's ESP-32s. Here's the example:

from stepper import Stepper
from machine import Pin

in1 = Pin(16,Pin.OUT)
in2 = Pin(17,Pin.OUT)
in3 = Pin(5,Pin.OUT)
in4 = Pin(18,Pin.OUT)
delay = 2
mode = 1 # 0 for half step, 1 for full step

def main() -> None:
    s1 = Stepper(in1, in2, in3, in4, delay, mode)
    s1.step(100)
    s1.step(100,-1)
    s1.angle(180)
    s1.angle(360,-1)

function angle is angle, and the PIN map: IN1 link PIN_16 IN2 link PIN_17 IN3 link PIN_5 IN4 link PIN_18 My uln2003 board like this, and stepper runing:
uln2003 uln2003