-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
I am not entirely sure where the error lies here, but I am trying to use a NodeMCU v1 together with a ESP-12E Motor Shield and a 28BYJ stepper motor. According to this link, the pins shall be 5, 0, 4, 2 or D1, D3, D2, D4.
However, when I try to spin the motor, I get a crash loop while I can hear the motor, but the shaft is not spinning. This is how the crash looks:
17:48:39.891 -> --------------- CUT HERE FOR EXCEPTION DECODER ---------------
17:48:39.891 ->
17:48:39.891 -> Soft WDT reset
17:48:39.891 ->
17:48:39.891 -> >>>stack>>>
17:48:39.891 ->
17:48:39.891 -> ctx: cont
17:48:39.891 -> sp: 3ffffd60 end: 3fffffc0 offset: 01a0
17:48:39.891 -> 3fffff00: 4020297d feefeffe feefeffe feefeffe
17:48:39.891 -> 3fffff10: 40100250 00000010 3ffee2e8 40100279
17:48:39.926 -> 3fffff20: 3ffe8622 3ffee2e8 00000010 4020120c
17:48:39.926 -> 3fffff30: 00000001 00000001 00000000 00000000
17:48:39.926 -> 3fffff40: 40201344 3ffee2e8 3ffee2e8 4020123a
17:48:39.926 -> 3fffff50: 40201344 3ffee330 00000739 4020129d
17:48:39.926 -> 3fffff60: 3ffee310 0000000c 3ffee330 402012cc
17:48:39.960 -> 3fffff70: 3ffee310 3ffee330 3ffee330 00000800
17:48:39.960 -> 3fffff80: 3ffee310 3ffee330 3ffee2e8 40201080
17:48:39.960 -> 3fffff90: feefeffe feefeffe feefeffe 3ffee398
17:48:39.960 -> 3fffffa0: 3fffdad0 00000000 3ffee358 40201b80
17:48:39.960 -> 3fffffb0: feefeffe feefeffe 3ffe84e0 40100be9
17:48:39.997 -> <<<stack<<<
This is the code:
#include <CheapStepper.h>
bool stepped = false;
const int stepsPerRevolution = 2048;
CheapStepper motor(D1, D3, D2, D4);
void setup() {
Serial.begin(74880);
motor.setTotalSteps(stepsPerRevolution);
motor.setRpm(17);
Serial.println("UP");
if (!stepped)
{
Serial.println("stepping ...");
motor.move(true, stepsPerRevolution);
stepped = true;
}
}
Can someone help me out? Is the NodeMCU or the shield maybe not compatible with this library?
I do know that the motor works with that board, because I was using the LUA firmware before, but now want to use C++/Arduino IDE.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels