mirror of
https://github.com/esphome/esphome.git
synced 2024-11-29 10:14:13 +01:00
Call Stepper::should_step_ every loop iteration (#1373)
This commit is contained in:
parent
b103be99e8
commit
06b8e4df27
1 changed files with 2 additions and 4 deletions
|
@ -14,8 +14,8 @@ void ULN2003::setup() {
|
||||||
this->loop();
|
this->loop();
|
||||||
}
|
}
|
||||||
void ULN2003::loop() {
|
void ULN2003::loop() {
|
||||||
bool at_target = this->has_reached_target();
|
int dir = this->should_step_();
|
||||||
if (at_target) {
|
if (dir == 0 && this->has_reached_target()) {
|
||||||
this->high_freq_.stop();
|
this->high_freq_.stop();
|
||||||
|
|
||||||
if (this->sleep_when_done_) {
|
if (this->sleep_when_done_) {
|
||||||
|
@ -28,8 +28,6 @@ void ULN2003::loop() {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this->high_freq_.start();
|
this->high_freq_.start();
|
||||||
|
|
||||||
int dir = this->should_step_();
|
|
||||||
this->current_uln_pos_ += dir;
|
this->current_uln_pos_ += dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue