I think I've finally got a design that works for the js code

500ms polling of the sliders and send commands to the arduino if
a command isn't currently pending