It looks like there is a minor typo for the tutorial http://www.espruino.com/Pixl.js+Wireless+Temperature+Display
in this line:
g.drawString(`${dev.name}: ${d.getUint8(0)}'C (${d.getUint8(0)}% bat)`,0,idx*6);
the battery level is displayed twice...
looks like that should reference a different element & read:
g.drawString(`${dev.name}: ${d.getUint8(1)}'C (${d.getUint8(0)}% bat)`,0,idx*6);
Also, in this same tutorial, I notice that making a slight adaptation to the puck code:
console.log("temperature: ", E.getTemperature());
gives a decimal temperature, e.g. "24.5",
yet the Pixl.js only displays the integer part with this
${d.getUint8(1)}'C
any hints for how to extract the entire decimal part?
@cottjr 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.
It looks like there is a minor typo for the tutorial http://www.espruino.com/Pixl.js+Wireless+Temperature+Display
in this line:
the battery level is displayed twice...
looks like that should reference a different element & read:
Also, in this same tutorial, I notice that making a slight adaptation to the puck code:
gives a decimal temperature, e.g. "24.5",
yet the Pixl.js only displays the integer part with this
any hints for how to extract the entire decimal part?