E.getTemperature() results when below zero

Posted on
  • 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:

    NRF.setAdvertising({
        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.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

E.getTemperature() results when below zero

Posted by Avatar for Eric @Eric

Actions