Question: Arduino programming question: I need to repeat the void loop in this code 8 times: #include const int stepsPerRevolution = 2048; // change this to
Arduino programming question: I need to repeat the void loop in this code 8 times:
#include
const int stepsPerRevolution = 2048; // change this to fit the number of steps per revolution const int rolePerMinute = 15; // Adjustable range of 28BYJ-48 stepper is 0~17 rpm
// initialize the stepper library on pins 8 through 11: Stepper myStepper(stepsPerRevolution, 8, 10, 9, 11);
int stepCount = 0; // number of steps the motor has taken
void setup() { myStepper.setSpeed(rolePerMinute); // initialize the serial port: Serial.begin(9600); }
void loop(){ myStepper.step(256); //eight 1/8 turns clockwise Serial.print("steps:"); Serial.println(stepCount); stepCount++; delay(500);
I need to repeat the loop 8 times then go to the next loop and repeat that 8 times, then loop the entire thing indefinitely
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
