Ahh - yes, it's because you're mixing the two methods of communication - the simple Puck.write/eval and the more complicated connection one.
Puck.write/eval
connection
You have two choices really:
Puck.eval("(Puck.light()", ...)
Modify the connection version to print both the light and the temperature:
connection.write("setInterval(function(){Bluetooth.println([Puck.light(),E.getTemperature()]);},100);\n", ...
You could find other ways to work around it, but I'd say those are your easiest options
@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.
Ahh - yes, it's because you're mixing the two methods of communication - the simple
Puck.write/eval
and the more complicatedconnection
one.You have two choices really:
Puck.eval("(Puck.light()", ...)
to get the light level when you need it)Modify the connection version to print both the light and the temperature:
You could find other ways to work around it, but I'd say those are your easiest options