Arduino – 28BYJ-48 Stepper Motors

Looking into using stepper motors for driving a robot chassis.
Suppliers on Ali-express at the time this is being written have these very cheap 28byj-48 stepper motors with gearbox along with a ULN2003 based Motor driver Module.
I found them rather slow. Turns out the exact number of steps for one full revolution varies between suppliers. (4096 or 4075.772839…)

This guy has written a similar article, and it references a superior library for the stepping control.
http://42bots.com/tutorials/28byj-48-stepper-motor-with-uln2003-driver-and-arduino-uno/

For What I did:

The board used is an ESPDuino. This is an Arduino UNO with an esp 8266 module replacing the usual processor.
basically you get Wifi but loose I/O.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
 
#include 
#include "Stepper.h"
 
/************************* Variables, Pins *********************************/
 
#define STEPS  32     // Number of steps per revolution of Internal shaft
int  Steps2Take;      // 2048 = 1 Revolution
 
// Setup of proper sequencing for Motor Driver Pins In1, In2, In3, In4 in the sequence 1-3-2-4
 
#define In1 0
#define In2 2
#define In3 4
#define In4 5
 
Stepper small_stepper(STEPS, In1, In3, In2, In4);
 
/************************* WiFi Access Point *********************************/
#define WLAN_SSID       "ENTER ACCESS POINT NAME HERE"
#define WLAN_PASS       "ENTER PASSWORD HERE"
 
 
void setup() 
{
  Serial.begin(115200);   
}  
 
void loop() 
{
  small_stepper.setSpeed(400); //Max seems to be 700
  Steps2Take  =  2048;  // Rotate CW
  small_stepper.step(Steps2Take);
  delay(1000);
 
 
  Serial.print("vals\n");
 
}