Control on and off of motor with millis function