Skip to content

Commit

Permalink
Last Commit
Browse files Browse the repository at this point in the history
Modified extreme temperature limits
  • Loading branch information
grimar2008 committed Oct 5, 2017
1 parent 53c8173 commit 1ea1214
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions C_DHT.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static PyObject * readSensor(PyObject *self, PyObject *args){
valid_message=1;
temperature=getTemp(bytes);
humidity=getHumid(bytes);
if(temperature>100 || temperature<-30 || humidity>100 || humidity<0) temperature=-39909, humidity=-39909, valid_message=0; //WHEN CHECKSUM FAILS
if(temperature>80 || temperature<-40 || humidity>100 || humidity<0) temperature=-39909, humidity=-39909, valid_message=0; //WHEN CHECKSUM FAILS, Read Documentation
}
free(bytes);
ret=Py_BuildValue("ffi",temperature,humidity,valid_message);
Expand All @@ -138,4 +138,3 @@ PyMODINIT_FUNC
initC_DHT(void){
(void)Py_InitModule("C_DHT", C_DHT22Methods);
};
//Dodati za minus temperature

0 comments on commit 1ea1214

Please sign in to comment.