• Hey, y'all. I have the MDBT42Q breakout board and I am trying to create a simple example where a button is pressed and the stepper motor rotates for like a half revolution.

    I am using the A4988 drivers and I have managed to connect and continuously rotate the stepper motor using this sample code:

    const PIN_ENABLE = D14; 
    const PIN_STEP = D13;
    const PIN_DIRECTION = D12;
    
    digitalWrite(PIN_DIRECTION, direction);
    digitalWrite(PIN_ENABLE, enabled);
    
    analogWrite(PIN_STEP, 0.9, {freq: 100});
    

    I am not sure though how is it possible to count the steps per revolution and how frequency is related to rotation and time.
    Thanks in advance for your help :)

About

Avatar for vorillaz @vorillaz started