Is there a library for ZUNO to control a stepper motor?

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
jeffhumster
Posts: 3
Joined: 22 Jun 2018 22:33

Is there a library for ZUNO to control a stepper motor?

Post by jeffhumster » 13 Jul 2018 22:58

Hello everyone, I am trying to control a step motor using ZUNO, I have seen arduino use the <stepper> library to control motor, I wonder does ZUNO has a similar library?

Any idea and suggestion is welcomed. :D

p0lyg0n1
Posts: 149
Joined: 04 Aug 2016 07:14

Re: Is there a library for ZUNO to control a stepper motor?

Post by p0lyg0n1 » 14 Jul 2018 19:10

Hi,
I have looked here https://github.com/arduino-libraries/St ... tepper.cpp.
The code is simple. There are no specific hardware features. The only thing that we have to modify is passing of parameters especially for constructors. In case of Z-Uno the stack usage is critical. Don't use large list of parameters, use pointers instead.
original code:

Code: Select all

Stepper::Stepper(int number_of_steps, int motor_pin_1, int motor_pin_2,
                                      int motor_pin_3, int motor_pin_4,
                                      int motor_pin_5)
{
Optimized code for Z-Uno (note I use byte instead of int)

Code: Select all

Stepper::Stepper(byte number_of_steps, byte * motor_pins)
{
You could try it yourself.

jeffhumster
Posts: 3
Joined: 22 Jun 2018 22:33

Re: Is there a library for ZUNO to control a stepper motor?

Post by jeffhumster » 15 Jul 2018 23:55

Thanks, I will try the solution, and will let u know how things going. Really appreciate your help.

Post Reply