#include <Stepper.h>
#include <LiquidCrystal.h>
const int stepsPer = 200;
Stepper myStepper(stepsPer,2,3,4,5);
const int buttonPin = 6;
int buttonState = 0;
LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
void setup() {
myStepper.setSpeed(60);
pinMode(buttonPin, INPUT_PULLUP);
lcd.begin(16, 2);
lcd.print("Motor Status:");
}
void loop() {
buttonState = digitalRead(buttonPin);
if (buttonState == LOW) {
myStepper.step(stepsPer);
lcd.setCursor(0, 1);
lcd.print("Forward ");
} else {
myStepper.step(-stepsPer);
lcd.setCursor(0, 1);
lcd.print("Reverse ");
}
}