mirror of
https://github.com/oliverschmidt/contiki.git
synced 2025-01-02 19:29:30 +00:00
Fix HDC sensor reading conversion
This commit is contained in:
parent
fbffcc2dfc
commit
f6a2c4ea3f
@ -186,7 +186,7 @@ static void
|
|||||||
convert(float *temp, float *hum)
|
convert(float *temp, float *hum)
|
||||||
{
|
{
|
||||||
/* Convert temperature to degrees C */
|
/* Convert temperature to degrees C */
|
||||||
*temp = ((double)(int16_t)raw_temp / 65536) * 165 - 40;
|
*temp = ((double)raw_temp / 65536) * 165 - 40;
|
||||||
|
|
||||||
/* Convert relative humidity to a %RH value */
|
/* Convert relative humidity to a %RH value */
|
||||||
*hum = ((double)raw_hum / 65536) * 100;
|
*hum = ((double)raw_hum / 65536) * 100;
|
||||||
|
Loading…
Reference in New Issue
Block a user