Instead of "0x" + str.substr(i, 2), you could try parseInt(str.substr(i, 2),16). Not much difference, but I guess it feels a bit more reliable :)
"0x" + str.substr(i, 2)
parseInt(str.substr(i, 2),16)
@Gordon started
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.
Instead of
"0x" + str.substr(i, 2)
, you could tryparseInt(str.substr(i, 2),16)
. Not much difference, but I guess it feels a bit more reliable :)