That's cool - do you think you'll be able to contribute a module to interface to the EEPROM when you're done?
Hopefully if you get a SOIC one you'll be able to solder it onto the proto area :)
I'm afraid that at the moment I think the best way of doing it is to just loop over the array and append to the string:
function arrayToString(arr) {
var s = "";
for (var i in arr)
s+=String.fromCharCode(arr[i])
return s;
}
In 'normal' JS you could do arr.map(String.fromCharCode).join(""), but it's not possible (referencing built-in functions) at the moment. If you desperately wanted to do it now you'd have to do arr.map(function(c){ return String.fromCharCode(c); }).join("")
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.
That's cool - do you think you'll be able to contribute a module to interface to the EEPROM when you're done?
Hopefully if you get a SOIC one you'll be able to solder it onto the proto area :)
I'm afraid that at the moment I think the best way of doing it is to just loop over the array and append to the string:
In 'normal' JS you could do
arr.map(String.fromCharCode).join("")
, but it's not possible (referencing built-in functions) at the moment. If you desperately wanted to do it now you'd have to doarr.map(function(c){ return String.fromCharCode(c); }).join("")