Greetings
Is there a way that I can 'save' a current DS3231 date/time, for use, later on?
I am designing a routine to check the time X number of times and then display that time that time later on.
Thanks
Greetings
Is there a way that I can 'save' a current DS3231 date/time, for use, later on?
I am designing a routine to check the time X number of times and then display that time that time later on.
Thanks
You can store it in EEPROM.
But explain it into more detail, what do you want to do? Aka, the real life application.
seymourmtn:
Greetings
Is there a way that I can 'save' a current DS3231 date/time, for use, later on?
I am designing a routine to check the time X number of times and then display that time that time later on.Thanks
typically, you would work with timestamps...
Can you try to explain again what it is you are trying to do?
How are you reading the time from the RTC ?
Presumably something like this
DateTime now = RTC.now();
year = now.year();
If so, then you could save the data in an array, a struct or EEPROM, for use later
To clarify my thinking.
Want to read sensor at 4 random times.
Using web server
When I do a page refresh, I would like to show the voltage reading and the time the sensor was read.
The next reset would move up the previous read but keep the time.
So, after 4 reads, I will see 4 different tome of reads
Hope this helps and I apologize for my new member dumdness
seymourmtn:
To clarify my thinking.Want to read sensor at 4 random times.
Using web server
When I do a page refresh, I would like to show the voltage reading and the time the sensor was read.
The next reset would move up the previous read but keep the time.
So, after 4 reads, I will see 4 different tome of readsHope this helps and I apologize for my new member dumdness
why not just
seymourmtn:
To clarify my thinking.Want to read sensor at 4 random times.
Using web server
When I do a page refresh, I would like to show the voltage reading and the time the sensor was read.
The next reset would move up the previous read but keep the time.
So, after 4 reads, I will see 4 different tome of readsHope this helps and I apologize for my new member dumdness
Whatever causes the time to be saved and however you display the last 4 readings you will need to save the data in one of the ways suggested.
I suggest that you start by saving the time when an button is pressed rather than some Web interaction and that once saved you display the 4 most recent values on the Serial monitor. The easiest way to do this is probably by saving values to arrays but they will be lost if the Arduino is turned off or reset. Is that important ? Once saved you can display the values. Given that as an objective do you know how to go about it ? If not then where are you stuck ?
Thought I would give an update on my project.
Thanks to efforts from this forum, I got things to work. There are a few cleanup code uses but the program is working as expected.
The sensors are about 50 yards from my house. The info is sent to a webpage via wifi, on a node mcu. I do a manual update, as setting an auto update, even at 50 seconds sucked my 10AH battery, which also powers some led lights at night.
Screen shot is attracted and thanks again.
Doug