hi i want to make countdown system for countdown the day for harvesting....so how can i read the RTC in 365 days
RTC libraries can usually report the day of the week so you can decrement the counter each time the day changes
solehinazrain:
hi i want to make countdown system for countdown the day for harvesting....so how can i read the RTC in 365 days
Forget about the Arduino and the RTC, for a minute. You have a clock and a calendar. Tell us how YOU would accomplish what you seek to do, which is not at all clear, given only those two items, some paper, and a pencil.
i want to do a system that can countdown my harvesting time for my plant in day...so i use the RTC to read the day...but i dont know how to read the rtc in day in 365 day not in a date...
but i dont know how to read the rtc in day in 365 day not in a date...
You would do that just like you read your calendar. Today is the 24th of July, 2019. My calendar has no idea how many days that is since you planted your crop (or whatever happened that was the starting point for your interval of interest).
You have to know what date that happened on, and CALCULATE (not READ), the interval between then and now. You read now (today's date) and calculate an interval, based on some other "now".
Indeed, most (all? don't now any at least) RTC's don't have a countdown/delta function. They just know the day. So like Paul said, it's up to you to (let the Arduino) calculate it. And yeah, that would pretty much be the same how you do it with a normal (paper) calendar.
Should be fairly easy to convert the date/time to unix time, then the time left to a specific date is a simple subtraction. Divide the answer by the number of seconds in a day will tell you how many days till the target date.
The Arduino Time library can read the RTC and make a Unix timestamp, which can then be used to do those sorts of calendar manipulations.
You might find that the crop won't be ready to harvest on the intended day, though.
You might find that the crop won't be ready to harvest on the intended day, though.
I'd be interested in what crop takes exactly 365 days from planting to harvesting, and that can be completely ignored for the entire interval. I'll be the cops would be, too.