Dear forum users.
I tried to modify the following example sketch
In the above sketch on a power boot of the Mbili you get a first reading and sending of data, and after that you get the reading and sending every READ_DELAY since a power boot...
What I tried to do is to schedule a first interval of reading and sending so that is done in a certain minutes of a hour, and after a first sending to repate the reading and sending every READ_DELAY (eg. if now is 21:34, and I defined to send a data at a 0 minutes of a hour, and to repeat the sending every 3600 ms, I wanted to send a first data at 22:00, and after that at 23:00 and every repetitively every hour at 0 minutes).
I tried to compare the actual minutes
to the defined minutes of sending. Then I set the new variable "FIRST_READ_DELAY", and configured the timer by the flowing line
This line is executed only once (before a first sending), and after that I re-configure the timer by the following line
The problem is that the program don't work as I wanted and after a first reading and sending instead to send every READ_DELAY the Mbili is sending randomly every minute to 45 seconds...
What I'm doing wrong? What is the easiest way to achieve what I wanted? Do you have any example so I can get a clue? Any help is appreciated.
Best regards, Paolo