tenbaht / sduino

An Arduino-like programming API for the STM8
http://tenbaht.github.io/sduino/
GNU Lesser General Public License v2.1
349 stars 213 forks source link

AccelStepper library integration (currrent stepper library does not offer simultanous motor move) #84

Closed tmmsunny012 closed 4 years ago

tmmsunny012 commented 4 years ago

Hi I was planning to move two-steppers at the same time using stepper but unable to do that with sduino library. I am a little new in sduino library .. can you suggest me how can I do that. In Arduino boards I found another library named accelStepper .. It allows running multiple steppers in the traditional Arduino boards.

tenbaht commented 4 years ago

Uh. I am afraid this would be a tough one to start with. The interface implementation for the Stepper library is one the most complicated libraries because it has both, multi-instance and polymorphism. And accelStepper adds another level on top of that by defining the MultiStepper class for timing coordination. It is probably possible, but I won't be easy.

My best advice is reading http://localhost:8000/api/migration/ and to get an idea about the relationship to the plain C API of the actual code of the regular stepper library.

Under the hood, everything is simple C functions. If you want to implement something like MultiStepper you can build on the plain C interface. The pre-processor magic can be added later. I could assist with that once you have a working implementation for MultiStepper.

Good luck,

Michael