X-Git-Url: https://git.rvb.name/weathermon.git/blobdiff_plain/438eca78d7802bd2758a4969b80bb0be6b9f14f6..2545d27aacfe57c8f26fccfd45e382fbf5c111ac:/Weather_Station.ino?ds=inline diff --git a/Weather_Station.ino b/Weather_Station.ino index 8ba7cee..9358d3d 100644 --- a/Weather_Station.ino +++ b/Weather_Station.ino @@ -71,6 +71,8 @@ SFE_BMP180 pressure; // DHT object for humidity sensor DHT dht; + +#define CO2_PIN A1 #define DHT_PIN 4 #define GAS_PIN A0 #define START_DELAY 20000 @@ -78,6 +80,48 @@ DHT dht; byte HasBaro; +#define READ_SAMPLE_INTERVAL 50 +#define READ_SAMPLE_TIMES 5 + +#define MQ135_RES 1000 + +float MQRead(int mq_pin) +{ + + int i; + float rs=0; + float rr; + + for (i=0;i