Community Forum
    • Blog
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    1. Home
    2. kgx123
    3. Posts
    K
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Groups 0

    Posts

    Recent
    • RE: Negative temperature measures

      Changes done to th02.cpp. Thanks! Seems to be working fine ::

      NEGATIVE TEMP:
      Starting Temperature conversion..done!
      Temperature = -7.00 C => -7.00 C

      Starting Temperature conversion..done!
      Temperature = -5.82 C => -5.80 C

      Starting Temperature conversion..done!
      Temperature = -2.10 C => -2.10 C

      Starting Temperature conversion..done!
      Temperature = -0.79 C => -0.80 C

      POSITIVE TEMP:
      Starting Temperature conversion..done!
      Temperature = 1.43 C => 1.40 C

      Starting Temperature conversion..done!
      Temperature = 2.87 C => 2.90 C

      posted in TH02
      K
      kgx123
    • Negative temperature measures

      Hi Charles-Henri,

      I am using your excellent TH02 library on Moteino. I have one sensor outside my house, with minus degrees celsius. However the TH02 lib reports the absolute value, without the minus prefix. E.g. “6.5” instead of “-6.5″. Please advise on what I am doing wrong.

      Merci beacoup,
      Karim

      From the Arduino sketch:

      int16_t temp, rh, rh_comp;
       //uint8_t status;
       
       Serial.print(F("Starting Temperature conversion."));
       sensor.startTempConv();
       sensor.waitEndConversion();
       Serial.println(F(".done!"));
      
       // Get temperature calculated and rounded
       temp = sensor.getConversionValue();
       
       // Display unrounded value (raw)
       Serial.print(F("Temperature = "));
       // this call does not do any I2C reading, it use last reading
       Serial.print(sensor.getLastRawTemp()/100.0);
       Serial.print(F(" C  =>  "));
       // Display now rounded value returned by 1st call
       Serial.print(temp/10.0);
       Serial.println(F(" C"));
      
      posted in TH02 temperature th02 negative library
      K
      kgx123