As long as a pulse is input at the input end of L298n, the stepping motor will take one step. If the motor simply rotates, as long as there is continuous pulse group input (just find a pulse generator, such as oscilloscope 1000Hz detection pulse), the stepping motor can continue to go on. As for the C language of the control chip, each has its own uses, and no one can help anyone. Unless you tell others all the conditions.