logo elektroda
logo elektroda
X
logo elektroda

[Solved] ESP8266 with DRV8825 Stepper Motor Controller Not Spinning Motor, Works on Arduino Uno

adi84_84 1008 2
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 17210695
    adi84_84
    Level 14  
    Hello everyone.
    I am using a DRV8825 stepper motor controller + bipolar motor. Using arduino uno the motor works fine but when i swap arduino to esp the motor does not work?

    Code: C / C++
    Log in, to see the code
    .
    Do you have a problem with Arduino? Ask question. Visit our forum Arduino.
  • ADVERTISEMENT
  • #2 17216380
    krzbor
    Level 27  
    It's hard to say what's wrong, but a good idea would be to connect LEDs to stepPin and dirPin with a resistor (for the red LED it's about 380R) and see if they flash properly. According to the code - stepPin should light the LED for about 0.1 seconds, turn it off for 1 second light it for 0.4 seconds and turn it off for a second etc. dirPin should light and turn the LED off every second or so. If this works then it is worth comparing the results with the UNO. If it doesn't work then you need to analyse the ESP more closely - has the program been uploaded correctly? Have the diodes been connected to the correct outputs etc.
  • #3 17219945
    adi84_84
    Level 14  
    I don't know why but after the change:

    delayMicroseconds(200);
    to
    delayMicroseconds(1000);

    got it going, supposedly the delay time is fixed and it should have no effect that the esp8266 is several times faster than the arduino.
    Closing topic
ADVERTISEMENT