int stp = 5; //connect pin 11 to step
int dir = 2; // connect pin 10 to dir
int buttonPin = 11;
int a = 0;
void setup()
{
pinMode(buttonPin, INPUT_PULLUP);
pinMode(stp, OUTPUT);
pinMode(dir, OUTPUT);
}
void loop()
{
setup();
if(digitalRead(buttonPin) == LOW) //functions based off of button pulling input pin LOW
{
a=0;
do
{
a++;
digitalWrite(stp, HIGH);
delay(10);
digitalWrite(stp, LOW);
delay(10);
}while(a<200);
}
}
int dir = 2; // connect pin 10 to dir
int buttonPin = 11;
int a = 0;
void setup()
{
pinMode(buttonPin, INPUT_PULLUP);
pinMode(stp, OUTPUT);
pinMode(dir, OUTPUT);
}
void loop()
{
setup();
if(digitalRead(buttonPin) == LOW) //functions based off of button pulling input pin LOW
{
a=0;
do
{
a++;
digitalWrite(stp, HIGH);
delay(10);
digitalWrite(stp, LOW);
delay(10);
}while(a<200);
}
}