Hello, i am trying to control a Stepper motor using a nodeMCU. I have a stepper driver that does 1 step every pulse. I got the stepper running at different speeds using:
analogWriteFreq(speed_frequency) analogWrite(D1, 500);
to stop: analogWrite(D1, 0)
My question is how can i count these pulses? For example if i need my stepper to do exactly 100 steps? I don't want to use digitalWrite() because that blocks the code when the stepper is running.