Hi,
Sorry for the delay. The issue is you're running that command in the web browser, and not on the Puck itself.
For instance to set the LED you do Puck.write("digitalWrite(LED1,1);\n"); not just digitalWrite(LED1,1);
Puck.write("digitalWrite(LED1,1);\n");
digitalWrite(LED1,1);
So what you need is:
Puck.eval("Puck.getBatteryPercentage()", function(value) { console.log(value); });
@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.
Hi,
Sorry for the delay. The issue is you're running that command in the web browser, and not on the Puck itself.
For instance to set the LED you do
Puck.write("digitalWrite(LED1,1);\n");
not justdigitalWrite(LED1,1);
So what you need is: