Arduino-unistep

Here’s a library that anyone can use to control multiple unistep stepper motors easily.

Download unistep library.

The library has been designed to accept simple commands of move(steps,direction), and therefore is really simple to use! make sure to drop the files into the correct library location, either within your Arduino file store or within the programs file store.

Here’s a little snippit of code to get something really simple working.

//inculde library
#include
//
//create a stepper instance
unistep stepper1(8,9,10,11,4096,900);
unistep stepper2(4,5,6,7,4096,900);
//
//for serial
int incomingByte;
//
void setup()
{
Serial.begin(9600);
}
//
void loop()
{
if (Serial.available() >0)
{
incomingByte=Serial.read();
if(incomingByte =='R')
{stepper1.moves(2000,1);
Serial.println(stepper1.print());
}
if(incomingByte =='L')
{stepper1.moves(2000,0);
Serial.println(stepper1.print());
}
if(incomingByte =='U')
{stepper2.moves(2000,1);
Serial.println(stepper2.print());
}
if(incomingByte =='D')
{stepper2.moves(2000,0);
Serial.println(stepper2.print());
}
}
}

It accepts an upper case letter other serial and then moves the corresponding stepper. Simple!

And here’s a youtube video on how it works and the code above.

Comments are closed.