The issue is the Puck.write call generates some output on the Puck. Then when eval is called, it receives whatever Puck.write output instead - I guess 'Puck.eval' could prefix the output with something - that would help to differentiate it from the output of write.
One option is to temporarily turn off the console output (echo) for the line you write - try puckCommand = "\x10setTime(" + n + ")\\n" and I imagine that'll fix it (it's just sending char code 16 at the start of the line)
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.
The issue is the
Puck.write
call generates some output on the Puck. Then wheneval
is called, it receives whateverPuck.write
output instead - I guess 'Puck.eval' could prefix the output with something - that would help to differentiate it from the output ofwrite
.One option is to temporarily turn off the console output (echo) for the line you
write
- trypuckCommand = "\x10setTime(" + n + ")\\n"
and I imagine that'll fix it (it's just sending char code 16 at the start of the line)