put pwm in while loop for output
js updates