I am logging temperatures using the E.getTemperature() function in a Puck and one night I read back values of 255C which on a very cold night assumed that it was actually -1.
Should we be doing anything to sign the results to allow temperatures below zero?
How exactly did you report the temperature back?
Looking at the code, it seems like it should work (or if it breaks it should return something other than 255) - my guess is that E.getTemperature() might actually be working correctly, and it's something else further down the line that's getting confused.
It is the very basic code you published for the Puck.js:
0x1809 : [Math.round(E.getTemperature())]
name: "Puck.js 13f1"
Perhaps I need to parse the results in node-red but its returning an unsigned int (I think)
Ahh - you're using EspruinoHub? It's entirely likely that EspruinoHub isn't doing be doing the conversion from unsigned to signed.
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem