It looks like you're posting C code, not JS. Did you want this converted to run on Espruino, or are you actually using an Arduino? If so, you'd need to find an Arduino forum to post on.
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.
It looks like you're posting C code, not JS. Did you want this converted to run on Espruino, or are you actually using an Arduino? If so, you'd need to find an Arduino forum to post on.