You need to put the pos-=posInc; inside the timeout.
Right now, that is being run between the setting of the timeouts. So all three timeouts get set, and pos gets incremented three times. Then, a second later, the timeouts start firing, with pos at it's final value for all of the timeouts, because it got incremented way back when the timeouts were set.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
You need to put the pos-=posInc; inside the timeout.
Right now, that is being run between the setting of the timeouts. So all three timeouts get set, and pos gets incremented three times. Then, a second later, the timeouts start firing, with pos at it's final value for all of the timeouts, because it got incremented way back when the timeouts were set.