projects
/
Arduino
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of mjesec.ffzg.hr:/git/Arduino
[Arduino]
/
rpi_promini
/
rpi_promini.ino
diff --git
a/rpi_promini/rpi_promini.ino
b/rpi_promini/rpi_promini.ino
index
38d318d
..
cfaa948
100644
(file)
--- a/
rpi_promini/rpi_promini.ino
+++ b/
rpi_promini/rpi_promini.ino
@@
-40,7
+40,7
@@
DallasTemperature sensors(&oneWire);
int int_0 = 300; // ms
int int_1 = 900; // ms
int wait = 2000; // ms
int int_0 = 300; // ms
int int_1 = 900; // ms
int wait = 2000; // ms
-int repeat =
20
; // times (5 times seem a little low for sensors which are more than 10m away)
+int repeat =
5
; // times (5 times seem a little low for sensors which are more than 10m away)
void send_315(char *code) {
Serial.print("send 315Mhz ");
void send_315(char *code) {
Serial.print("send 315Mhz ");
@@
-114,11
+114,13
@@
unsigned long time = millis();
void loop() {
if ( millis() - time > 2000 ) {
float t = dht.getTemperature();
void loop() {
if ( millis() - time > 2000 ) {
float t = dht.getTemperature();
- if ( dht.getStatus() == 0 )
+ float delta_t = abs(t - temp_avg.getAverage());
+ if ( dht.getStatus() == 0 && delta_t < 10 )
temp_avg.addValue( t );
else dht22_errors++;
float h = dht.getHumidity();
temp_avg.addValue( t );
else dht22_errors++;
float h = dht.getHumidity();
- if ( dht.getStatus() == 0 )
+ float delta_h = abs(h - hum_avg.getAverage());
+ if ( dht.getStatus() == 0 && delta_h < 10 )
hum_avg.addValue( h );
else dht22_errors++;
time = millis();
hum_avg.addValue( h );
else dht22_errors++;
time = millis();