You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a project running on an esp32 where I only need to move a motor every few minutes, and I'm using deep sleep to reduce the power consumption. However, the motor is still powered (which probably uses more power than the esp32 itself), so I tried to call stepper.disableOutputs(), but it turns out that somehow the output pins are re-enabled when the esp32 enters deep sleep.
Here is some code to reproduce the problem:
#include<AccelStepper.h>
#defineIN15
#defineIN218
#defineIN319
#defineIN421// Create an instance of AccelStepper
AccelStepper stepper(AccelStepper::HALF4WIRE, IN1, IN3, IN2, IN4);
voidsetup() {
// Initialize the serial port
Serial.begin(115200);
stepper.moveTo(123);
stepper.runToPosition();
stepper.disableOutputs();
sleep(3); // Wait for three seconds to have time to observe the outputs.// Outputs are now all low
Serial.println("Entering deep sleep");
esp_deep_sleep(10000000);
// Some outputs are enabled again, reflecting the last motor position before disabling outputs.
}
I'm not sure this is relevant, but this project is using a unipolar 28BYJ-48 stepper motor.
Any idea what could be causing this issue, and how it could be possible to disable outputs while the esp is in deep sleep?
The text was updated successfully, but these errors were encountered:
I have a project running on an esp32 where I only need to move a motor every few minutes, and I'm using deep sleep to reduce the power consumption. However, the motor is still powered (which probably uses more power than the esp32 itself), so I tried to call
stepper.disableOutputs()
, but it turns out that somehow the output pins are re-enabled when the esp32 enters deep sleep.Here is some code to reproduce the problem:
I'm not sure this is relevant, but this project is using a unipolar 28BYJ-48 stepper motor.
Any idea what could be causing this issue, and how it could be possible to disable outputs while the esp is in deep sleep?
The text was updated successfully, but these errors were encountered: