I have a program that is sending pulses to a stepper motor with a delay of 5 milliseconds after the motor is switched to high, and a delay of 5 milliseconds after the motor is switched to low.
digitalWrite(2, HIGH);
delay(5);
digitalWrite(2, LOW);
delay(5);
This code is in a while loop until the switch is released. So when the switch is high the motor is pulsing.
while(digitalRead(5) == HIGH)
{
...
}
i also have a counter in the loop to count how many times the motor has pulsed. I want to show this number on an serial LCD from sparkfun. It has not been working, so i was thinking that displaying the number every time, goes to fast to see on the LCD screen. So i wanted to know how i could show the pulses on the LCD and how fast the LCD can refresh. Thanks