@@ -54,7 +54,8 @@ A stepper motor follows the turns of a potentiometer (or other sensor) on analog
5454// create an instance of the stepper class, specifying
5555// the number of steps of the motor and the pins it's
5656// attached to
57- Stepper stepper(STEPS, 8, 9, 10, 11);
57+ // (note the order for 2th and 3th pins)
58+ Stepper stepper(STEPS, 8, 10, 9, 11);
5859
5960// the previous reading from the analog input
6061int previous = 0;
@@ -88,7 +89,8 @@ const int stepsPerRevolution = 200; // change this to fit the number of steps p
8889// for your motor
8990
9091// initialize the stepper library on pins 8 through 11:
91- Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);
92+ // (note the order for 2th and 3th pins)
93+ Stepper myStepper(stepsPerRevolution, 8, 10, 9, 11);
9294
9395void setup() {
9496 // set the speed at 60 rpm:
@@ -121,7 +123,8 @@ const int stepsPerRevolution = 200; // change this to fit the number of steps p
121123// for your motor
122124
123125// initialize the stepper library on pins 8 through 11:
124- Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);
126+ // (note the order for 2th and 3th pins)
127+ Stepper myStepper(stepsPerRevolution, 8, 10, 9, 11);
125128
126129int stepCount = 0; // number of steps the motor has taken
127130
@@ -153,7 +156,8 @@ const int stepsPerRevolution = 200; // change this to fit the number of steps p
153156
154157
155158// initialize the stepper library on pins 8 through 11:
156- Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);
159+ // (note the order for 2th and 3th pins)
160+ Stepper myStepper(stepsPerRevolution, 8, 10, 9, 11);
157161
158162int stepCount = 0; // number of steps the motor has taken
159163
@@ -173,4 +177,4 @@ void loop() {
173177 myStepper.step(stepsPerRevolution / 100);
174178 }
175179}
176- ```
180+ ```
0 commit comments