X-Git-Url: https://git.rvb.name/weathermon.git/blobdiff_plain/42bd3e809b0fa95d3a463462e242caf40d98bf79..769d0bd71b19b467c195838379a379e0e2d69c2b:/Weather_Station.ino 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