From 5bff0d64d2931ed5c699737635cbf56ae3d00bc0 Mon Sep 17 00:00:00 2001 From: shakemid Date: Fri, 15 Sep 2017 23:27:46 +0900 Subject: [PATCH] Fix formula for humidity --- pcsensor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcsensor.c b/pcsensor.c index 00dc725..f560698 100644 --- a/pcsensor.c +++ b/pcsensor.c @@ -327,7 +327,7 @@ void decode_answer_sht1x(unsigned char *answer, float *tempd, float *calibration // relative humidity buf = ((signed char)answer[4] << 8) + (answer[5] && 0xFF); tempd[1] = -2.0468 + 0.0367 * buf - 1.5955e-6 * buf * buf; - tempd[1] = ( tempd[0] - 25 ) * ( 0.01 + 0.00008 * tempd[1] ) + tempd[1]; + tempd[1] = ( tempd[0] - 25 ) * ( 0.01 + 0.00008 * buf ) + tempd[1]; if (tempd[1] < 0) tempd[1] = 0; if (tempd[1] > 99) tempd[1] = 100; };