Library: StepperMotor for Arduino Motor Shield

Hi,
I couldnt find a library to control my stepper motor in an easy way. I had to do that for my degree project, so I made a simple library to control the stepper.

I tested the library with an Arduino Uno + Rev3 motor shiled + MEMA17 stepper. But you can find the methods to create a diferent instance of the motor with diferent parameters.

I’ll attach the library in this post if someone finds it helpfull.

Agur!

StepperMotor.cpp (6.11 KB)

StepperMotor.h (1.67 KB)

Thanks for sharing.

I don't immediately understand why you use analogWrite() ?

It would also be a good idea to replace delay() with millis() or micros() so as not to block the Arduino.

...R

:o It was a mistake! :confused: (It doesnt affect to the performance but it has no sense... you're right) It should be digital write like the others.

And yes the best way would be using other methods whose usage didn't block the Arduino... I'm pretty noob in Arduino programming... I didnt know that method. Right now i've not the time to work on it, but I'll correct that later, thanks!

Slevin217: And yes the best way would be using other methods whose usage didn't block the Arduino... I'm pretty noob in Arduino programming... I didnt know that method. Right now i've not the time to work on it, but I'll correct that later, thanks!

Have a look at several things at a time.

...R