starting and stopping motor based on led status