mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-17 22:23:10 +03:00
Stepper: fixed indentation
This commit is contained in:
@ -194,21 +194,25 @@ void Stepper::step(int steps_to_move)
|
|||||||
|
|
||||||
|
|
||||||
// decrement the number of steps, moving one step each time:
|
// decrement the number of steps, moving one step each time:
|
||||||
while(steps_left > 0) {
|
while (steps_left > 0)
|
||||||
|
{
|
||||||
unsigned long now = micros();
|
unsigned long now = micros();
|
||||||
// move only if the appropriate delay has passed:
|
// move only if the appropriate delay has passed:
|
||||||
if (now - this->last_step_time >= this->step_delay) {
|
if (now - this->last_step_time >= this->step_delay)
|
||||||
|
{
|
||||||
// get the timeStamp of when you stepped:
|
// get the timeStamp of when you stepped:
|
||||||
this->last_step_time = now;
|
this->last_step_time = now;
|
||||||
// increment or decrement the step number,
|
// increment or decrement the step number,
|
||||||
// depending on direction:
|
// depending on direction:
|
||||||
if (this->direction == 1) {
|
if (this->direction == 1)
|
||||||
|
{
|
||||||
this->step_number++;
|
this->step_number++;
|
||||||
if (this->step_number == this->number_of_steps) {
|
if (this->step_number == this->number_of_steps) {
|
||||||
this->step_number = 0;
|
this->step_number = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
if (this->step_number == 0) {
|
if (this->step_number == 0) {
|
||||||
this->step_number = this->number_of_steps;
|
this->step_number = this->number_of_steps;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user