how to control a dc motor by taking the user input? Answered
I am trying to write a code to control a DC motor with the user input. The motor needs to stop after N iterations where N is given by the user. Each iteration doesn't have a specific time hence I used an IR sensor. The motor must rotate until the IR value is high and in N iterations the IR value becomes N times low. I hope you understand my question. Please help me with the code.