const int dirPin = 2;
const int stepPin = 3;
const int boton1 = 8;
const int boton2 = 9;
void setup() {
pinMode(dirPin, OUTPUT);
pinMode(stepPin, OUTPUT);
pinMode(boton1,INPUT_PULLUP);
pinMode(boton2,INPUT_PULLUP);
}
void loop() {
if(digitalRead(boton1)==LOW){
digitalWrite(dirPin, HIGH);
digitalWrite(stepPin, HIGH);
delayMicroseconds(1500);
digitalWrite(stepPin, LOW);
delayMicroseconds(1500);
}
if(digitalRead(boton2)==LOW){
digitalWrite(dirPin, LOW);
digitalWrite(stepPin, HIGH);
delayMicroseconds(1500);
digitalWrite(stepPin, LOW);
delayMicroseconds(1500);