Giter VIP home page Giter VIP logo

uln2003-for-esp32's Introduction

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:

import Stepper
from machine import Pin
s1 = Stepper.create(Pin(16,Pin.OUT),Pin(17,Pin.OUT),Pin(5,Pin.OUT),Pin(18,Pin.OUT), delay=2)
s1.step(100)
s1.step(100,-1) # or s1.step(-100)
s1.angle(180)
s1.angle(360,-1) # or s1.angle(-360)

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

uln2003-for-esp32's People

Contributors

jej avatar zhcong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

uln2003-for-esp32's Issues

runs to 4 steps per step

at first i thought i only understood the code wrong but, it runs through the complete self.mode array per step. A code should only jump one array further and not through the complete array. so one step becomes 4.

Is it possible to control speed of steps?

Thank you very much for uploading this small efficient code.
It saved me a bit of time.

Is it possible to control the speed of the motor?

Is it currently it is sending a step command at the rate of the esp32 clock?

Cheers,
Adrian

Half Step Direction Is Backwards

With a positive step value, the motor runs CCW in HALF_STEP mode, and CW in FULL_STEP mode. Seems the HALF_STEP direction is incorrect.

I added a step sequence to drive a filter slider in an OPTEC SSP-3A photometer using your code. OPTEC recommends a particular step pattern:

SSP_STEP = [
[1, 1, 0, 0],
[0, 1, 1, 0],
[0, 0, 1, 1],
[1, 0, 0, 1]
]

This also runs CW as expected.

Thanks so much for you code, it was invaluable to get me started on my CCD photometer project.

barko33

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.