@@ -189,26 +189,30 @@ void Stepper::step(int steps_to_move)
189
189
int steps_left = abs (steps_to_move); // how many steps to take
190
190
191
191
// determine direction based on whether steps_to_mode is + or -:
192
- if (steps_to_move > 0 ) {this ->direction = 1 ;}
193
- if (steps_to_move < 0 ) {this ->direction = 0 ;}
192
+ if (steps_to_move > 0 ) { this ->direction = 1 ; }
193
+ if (steps_to_move < 0 ) { this ->direction = 0 ; }
194
194
195
195
196
196
// decrement the number of steps, moving one step each time:
197
- while (steps_left > 0 ) {
198
- unsigned long now = micros ();
199
- // move only if the appropriate delay has passed:
200
- if (now - this ->last_step_time >= this ->step_delay ) {
197
+ while (steps_left > 0 )
198
+ {
199
+ unsigned long now = micros ();
200
+ // move only if the appropriate delay has passed:
201
+ if (now - this ->last_step_time >= this ->step_delay )
202
+ {
201
203
// get the timeStamp of when you stepped:
202
204
this ->last_step_time = now;
203
205
// increment or decrement the step number,
204
206
// depending on direction:
205
- if (this ->direction == 1 ) {
207
+ if (this ->direction == 1 )
208
+ {
206
209
this ->step_number ++;
207
210
if (this ->step_number == this ->number_of_steps ) {
208
211
this ->step_number = 0 ;
209
212
}
210
213
}
211
- else {
214
+ else
215
+ {
212
216
if (this ->step_number == 0 ) {
213
217
this ->step_number = this ->number_of_steps ;
214
218
}
0 commit comments