Yeah, the issue is that fs.appendFile("log0.txt", d) (and pretty much any 'write' command) iterates over the given array, assuming each element is a byte (even if you supply a UintXYZArray). It makes more sense if you think of what you'd want if you supplied just a simple array like [1,2,3,4].
All you need to do to write is fs.appendFile("log0.txt", d.buffer)
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.
Yeah, the issue is that
fs.appendFile("log0.txt", d)
(and pretty much any 'write' command) iterates over the given array, assuming each element is a byte (even if you supply aUintXYZArray
). It makes more sense if you think of what you'd want if you supplied just a simple array like[1,2,3,4]
.All you need to do to write is
fs.appendFile("log0.txt", d.buffer)