The issue is the code that you're running is actually calling the function Puck.light() on the device itself. There is no light sensor on the board you're trying, so it has no Puck.light() function and the call causes an error.
If you replace Puck.light() for something all boards have like E.getTemperature() then it'd be fine.
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.
You just use exactly the same code. The
puck.js
library works fine on any Bluetooth Espruino.If you tried the first example on https://www.espruino.com/Puck.js+Web+Bluetooth that'd have worked just fine.
The issue is the code that you're running is actually calling the function
Puck.light()
on the device itself. There is no light sensor on the board you're trying, so it has noPuck.light()
function and the call causes an error.If you replace
Puck.light()
for something all boards have likeE.getTemperature()
then it'd be fine.