when reading data using the .on('data', function(data) {...}), do I need to create a buffer out of the string? Is the data always string? The docs seem to say so
Yes, the data is always a string. You can use it as-is using data.charCodeAt(..), but if you want to access the binary data as an array, a nice easy way is to use E.toArrayBuffer(string)
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.
Great, glad it's going!
Yes, the data is always a string. You can use it as-is using
data.charCodeAt(..)
, but if you want to access the binary data as an array, a nice easy way is to use E.toArrayBuffer(string)