The scale is there to ensure that the values which were fractional can be saved in the Uint16Array (which is much more efficient memory-wise). I have no idea why it's 5000 though.
The strange values will be because you're approaching such high G that the value is going above 32767 (the max range of uint16array) and wrapping over.
Maybe just try using a smaller number for SCALE and that'll fix it
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.
The scale is there to ensure that the values which were fractional can be saved in the Uint16Array (which is much more efficient memory-wise). I have no idea why it's 5000 though.
The strange values will be because you're approaching such high G that the value is going above 32767 (the max range of uint16array) and wrapping over.
Maybe just try using a smaller number for SCALE and that'll fix it