We have modified the motor code, and the gears attached to the motor now make 6 revolutions in 1 minute. So that the ratio between the gears is correct. Finally, our motor turns counterclockwise
#include <Stepper.h>
const int stepsPerRevolution = 2048; // Steps for one full revolution
// Pin configuration for the 28BYJ-48 motor
Stepper myStepper(stepsPerRevolution, 8, 10, 9, 11);
void setup() {
// Set speed to 6 revolutions per minute
myStepper.setSpeed(6);
}
void loop() {
// Continuously rotate the motor at 6 RPM
myStepper.step(-1); // One step at a time, speed controlled by setSpeed()
}
maxandre.lena
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.