Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Oregon_Decoder_V2_V3
Revision 14:a9984c6f6257, committed 2021-04-04
- Comitter:
- sev2000
- Date:
- Sun Apr 04 10:36:07 2021 +0000
- Parent:
- 13:87e9b1cd65c2
- Commit message:
- Add erroneous data filter
Changed in this revision
OregonBit.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/OregonBit.cpp Sat Jul 18 07:58:04 2020 +0000 +++ b/OregonBit.cpp Sun Apr 04 10:36:07 2021 +0000 @@ -367,7 +367,11 @@ data[channel].hum1= (float)tmp; DBG("Humidity: %d", tmp); - data[channel].timestamp=time(NULL); + // Filter results + if(data[channel].temp1 > -10 && data[channel].temp1<50 && data[channel].hum1 > 0 && data[channel].hum1 <=100) + data[channel].timestamp=time(NULL); + else + data[channel].timestamp=0; } else ERR("Checksum error %X", chksum); @@ -470,7 +474,11 @@ data[channel].hum1= (float)tmp; DBG("Humidity: %d", tmp); - data[channel].timestamp=time(NULL); + // Filter results + if(data[channel].temp1 > -10 && data[channel].temp1<50 && data[channel].hum1 > 0 && data[channel].hum1 <=100) + data[channel].timestamp=time(NULL); + else + data[channel].timestamp=0; } else