You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/RainGauge/RainGauge.ino
+69-65Lines changed: 69 additions & 65 deletions
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
4
4
April 26, 2015
5
5
6
-
Version 1.4.1 alpha
6
+
Version 2.0
7
7
8
8
Arduino Tipping Bucket Rain Gauge
9
9
@@ -29,38 +29,36 @@
29
29
* Optional Temp/Humidity (DHT-22 or DHT-11) and Light LUX (BH1750) sensors. To use, uncomment
30
30
#define DHT_ON and/or #define LUX_ON
31
31
* Optionally send total accumulation of each day's rainfall or send only individual days rainfall totals.
32
-
Comment out #define USE_DAILY to display individual daily rainfall.
32
+
Uncomment #define USE_DAILY to display individual daily rainfall. If it is commented out it will display
33
+
a cumulative total rainfall (day4 = day1+day2+day3+day4 etc)
33
34
34
35
by @BulldogLowell and @PeteWill for free public use
35
36
36
37
*/
37
38
38
-
// Enable debug prints to serial monitor
39
-
#defineMY_DEBUG
39
+
//#define MY_DEBUG // Enable MySensors debug prints to serial monitor
40
40
41
41
// Enable and select radio type attached
42
42
#defineMY_RADIO_NRF24
43
43
//#define MY_RADIO_RFM69
44
44
45
-
//#define MY_NODE_ID 7
45
+
//#define MY_NODE_ID 7 //uncomment this line to assign a static ID
46
46
47
-
#include<SPI.h>
48
-
#include<MySensors.h>
49
47
#include<math.h>
50
48
#include<TimeLib.h>
49
+
#include<MySensors.h>
51
50
52
51
#defineSKETCH_NAME"Rain Gauge"
53
-
#defineSKETCH_VERSION"1.4.1a"
52
+
#defineSKETCH_VERSION"2.0"
54
53
55
-
#defineDWELL_TIME125// this allows for radio to come back to power after a transmission, ideally 0
54
+
#defineDWELL_TIME40// this allows for radio to come back to power after a transmission, ideally 0
56
55
57
-
//#define DEBUG_ON // comment out this line to disable serial debug
56
+
//#define DEBUG_ON // Rain gauge specific debug messages.
58
57
#defineDHT_ON// uncomment out this line to enable DHT sensor
59
58
#defineLUX_ON// uncomment out this line to enable BH1750 sensor
60
-
//#define USE_DAILY // displays each time segment as an accumulation of prior periods inclusive. Comment out to display individual daily rainfall totals in the variables sent to your controller.
59
+
//#define USE_DAILY // Uncomment to display individual daily rainfall totals in the variables sent to your controller. If it's commented it will add each day to the next for a cumulative total.
61
60
62
61
#defineTIP_SENSOR_PIN3
63
-
64
62
#defineCALIBRATE_FACTOR60// amount of rain per rain bucket tip e.g. 5 is .05mm
65
63
#defineDHT_LUX_DELAY300000//Delay in milliseconds that the DHT and LUX sensors will wait before sending data
0 commit comments