Following this tutorial: https://www.instructables.com/id/Motorized-WiFi-IKEA-Roller-Blind/
I have a NodeMCU v1.0 (ESP-12E) board together with a ESP-12E Motor Shield and a 28BYJ-48 stepper motor.
The LUA-Code from the tutorial works, but flashing the NodeMCU using the flashing tools provided by the tutorial & writing code in LUA is cumbersome.
Therefore, I would like to use the Arduino IDE to program the board in C++. However, I cannot seem to get it to work, using the basic Stepper library provided by the Arduino IDE. I am using pins 1,2,3,4 as well as 2038 steps per revolution and 15 RPM.
However, when trying to move the motor, the board is constantly crashing. Can someone help me out?
This is the code:
#include <Stepper.h>
bool stepped = false;
const int stepsPerRevolution = 2038;
Stepper myStepper(stepsPerRevolution, 1, 3, 2, 4);
void setup() {
Serial.begin(74880);
myStepper.setSpeed(15);
Serial.println("UP");
}
void loop() {
if (!stepped)
{
Serial.println("stepping ...");
myStepper.step(stepsPerRevolution);
stepped = true;
}
}