I am developing a feedback control system using Arduino UNO , a simple dc geared motor and an optical incremental encoder (400 PPR) . I am supposed to write a write a program using Arduino IDE such that I am able to provide RPM from from serial monitor to the Arduino UNO which will in turn provide the concerned PWM value to the L298 motor driver module. Due to this the motor will start rotating and the RPM will be read by the encoder and the RPM so read by the encoder will get printed on serial monitor in vertical format ( one below the other ) .Sir, I want to make this system such that it should be a complete closed loop system and should respond in a very quick manner ( I really don't know how quick ) but the response should be good . Kindly provide me the guidance and the code as soon as possible . Thank you