How Arduino code controls DC motor speed?