hannobraun / stepper

Universal Stepper Motor Interface
Other
107 stars 17 forks source link

How to implement a ULN2003 driver? #150

Closed joepie91 closed 1 year ago

joepie91 commented 1 year ago

I'm looking to implement a driver for the ULN2003 "stepper driver" (more like a transistor array), but this doesn't have DIR/STEP pins; instead, you're expected to directly drive the individual coils (like the Arduino Stepper library does, for example).

However, if I'm understanding the driver API design correctly, it's expecting the driver to essentially provide a DIR and STEP pin to the library; which don't exist in this case, as this needs to be implemented in software and translated to coil pins. How would I go about implementing this?

(Note that I don't have a lot of Rust experience yet, so I may be misreading the API design!)

hannobraun commented 1 year ago

All the drivers expect STEP/DIR pins, but the original plan for this library was to provide a universal interface over different kinds of stepper drivers. It should be possible to write drivers for different kinds of chips, but it would likely require some redesign of the API, as well as additional code to make the motion control stuff work for the new driver.

I don't think this is a task for a Rust beginner, especially since I don't have the bandwidth to guide this kind of work as a maintainer. If this were to happen, it would require someone who's comfortable with really digging into the library without much help.

Unless your goal is to have a unified API over the ULN2003 and other drivers, it's probably more practical to ignore this library and talk to the driver directly.