In Steve's code, PWM command should be in the main loop.