Activity No. 3 Controlling stepper motor
Name: Colonia, Jenelou A.
Date started: April, 23, 2022
Date finished April, 24, 2022
year and section: BSMX 3A night
// Include the stepper library
#include <Stepper.h>
// Define the number of steps per revolution
const int stepsPerRevolution = 2048;
// Initialize the stepper motor
Stepper myStepper(stepsPerRevolution, 8, 10, 9, 11);
void setup() {
// Set the speed of the stepper motor (adjust to suit your needs)
myStepper.setSpeed(5);
}
void loop() {
// Step the motor one full revolution clockwise
myStepper.step(stepsPerRevolution);
// Delay for a moment before continuing (adjust to suit your needs)
delay(1000);
}