Controlling stepper motor with serial monitor - motor stops during each read

Rather than send data in a 2-step process send a single message - for example 'F' 'R' or 'S'

OR, if the 'd' character is needed for some other purpose send dF dR or dS, Better still would be to send etc. See Serial Input Basics

Do NOT use a blocking WHILE when using the accelstepper library.

...R