I think your issue was e.data != "\r" || e.data != "\n" because it'll always be true - it should be e.data != "\r" && e.data != "\n"
e.data != "\r" || e.data != "\n"
e.data != "\r" && e.data != "\n"
I guess the thing to do is to use the \r as a signal that the data has ended:
\r
if (e.data == "\r" || e.data == "\n") { print(myValue); myValue=""; } else { myValue+=e.data; }
@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.
I think your issue was
e.data != "\r" || e.data != "\n"
because it'll always be true - it should bee.data != "\r" && e.data != "\n"
I guess the thing to do is to use the
\r
as a signal that the data has ended: