motor and led timing code