New library for 28BYJ-48 stepper motors with ULN2003APG drivers

Hi all,

I bought a pair of stepper motors together with their driver boards. They seem to be pretty popular.
The stepper motor is a 28BYJ-48.
The driver board uses a ULN2003APG chip.

To my surprise, none of the many stepper motor control libraries I tested worked well with my setup.

So while I’m fairly new to C++ and Arduino, I took the opportunity to dig into the control of these motors and learn how to create my own library. And since it works well, I thought I’d share it.

So here are the files. The help text contains an example.
Hope it helps.

Cheers

OliStepper help.txt (2.5 KB)

OliStepper.cpp (5.33 KB)

OliStepper.h (1.06 KB)

I just tried this library - happened to be fiddling with exactly the same motor and driver. I tried the same you have in the txt file, but an error came up however on this line:

moteur1.setDirection ("STOP");

Error said:

C:\Users\e60082\AppData\Local\Temp\arduino_997c2dea0ab5add7d62f172b24c52f5a\sketch_oct08b.ino: In function 'void setup()':

sketch_oct08b:8: error: invalid conversion from 'const char*' to 'word {aka unsigned int}' [-fpermissive]

moteur1.setDirection ("CW");

Have I done something wrong?

i tested your code : excellent !!!!

one small question : what's the way to speed up to speed of the motor ? i'm using the same motor and driverboard.

thanks in advance Jan

great! same motors and drivers, it works for me.