when temperature are negatives values are not corrects
indeed if negative temperature the hex value is of type 0xffe9 for example giving a number > 65000, to deduct the negative value we need to substract 0xffff to the hex value
This commit is contained in:
1 parent
a0d001f0b4
commit
597a18165f
1 file changed
+1
@@ -322,6 +322,7 @@ boolean process_miflora_data(int offset, char * rest_data, char * mac_adress){
|
|||||||
break;
|
break;
|
||||||
case '4' :
|
case '4' :
|
||||||
mactopic = mactopic + "/" + "tem";
|
mactopic = mactopic + "/" + "tem";
|
||||||
|
if (value > 65000) value = value - 65535;
|
||||||
dtostrf(value/10,3,1,val); // temp has to be divided by 10
|
dtostrf(value/10,3,1,val); // temp has to be divided by 10
|
||||||
break;
|
break;
|
||||||
case '7' :
|
case '7' :
|
||||||
|
|||||||
Reference in new issue
Block a user