How to water a lemon tree with Arduino PRO MINI, a RTC and a pump.
How avoid a freezer disaster while I am away.
Project tutorial by mbraccagni
I'm happy to be of service!
I used the subroutine readDS3231time(byte second,byte minute,byte *hour,byte *dayOfWeek,byte *dayOfMonth,byte *month,byte *year) to read seconds, minutes, hours, the day of the week.
The easiest solution, I think, is to use pin 8 or pin 9 or both as multipliers to set more then 8 days.
If you modify line 98 as follow
giorni = (4digitalRead(5) + 2*digitalRead(6) + digitalRead(7) +1) * (digitalRead(8)*10 +1);
you will count from 1 to 8 days (giorni) setting pin 8 = LOW, or 10, 20, 30, ... 80 days setting pin 8 = HIGH.
6 months are 180 days, so if you modify line 98 as follow
giorni = (4digitalRead(5) + 2*digitalRead(6) + digitalRead(7) +1) * (digitalRead(8)*10 + 1) * (digitalRead(9)*3 + 1);
and set pins 5 = HIGH, 6 = LOW, 7 = HIGH, 8 = HIGH, 9 = HIGH, you will obtain 6 x 10 x 3 = 180.
But if you don't need any regulation, you can also write:
giorni = 180;
and that's it!
ATTENTION: the variable minutiMancanti is defined as integer! maybe you must redefine it as long integer, because 6 months are many more the 32000 minutes!!!!!!
286 comments on Arduino Project Hub! And all with the same text!!! WOW
Or connect with your social account:
New here? Create an account