Skip to content

Library to handle 28byj-48 motor steppers (works with esp8266)

License

Notifications You must be signed in to change notification settings

RobAxt/simple-stepper

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Library to handle 28byj48 stepper motors

This library is compabitle with esp8266 and it has been designed with simplicity in mind, so it's useful for education purposes. It can't handle acceleration, for that use AccelStepper instead.

The library supports the three sequence methods: Wake Drive, Full Step and Half Step.

Here is a great video about the 28BYJ-48 and how it works: https://youtu.be/B86nqDRskVU

Connection

You can connect one stepper to an ULN2003, or two to an ULN2803:

uln2803 with two 28byj-48

Examples

One motor

#include <SimpleStepper.h>

SimpleStepper stepper(SimpleStepper::FULLSTEP, D5, D6, D7, D8)

void loop ()
{
  stepper.steps(stepper.getFullRotationSteps());

  while ( ! stepper.ready())
  {
    stepper.step();
    delay(3);
    yield();
  }
}

Two motors

#include <SimpleStepper.h>

SimpleStepper stepper1(SimpleStepper::FULLSTEP, D1, D2, D3, D4)
SimpleStepper stepper2(SimpleStepper::HALFSTEP, D5, D6, D7, D8)

void loop ()
{
  stepper1.steps(stepper1.getFullRotationSteps());
  stepper2.steps(stepper2.getFullRotationSteps());

  while ( ! stepper1.ready() || ! stepper2.ready() )
  {
    stepper1.step();
    stepper2.step();
    delay(3);
    yield();
  }
}

About

Library to handle 28byj-48 motor steppers (works with esp8266)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 100.0%