(2017-08-19, 12:24)IamaRobot Wrote: Hi SimenZhor! Thanks for your quick reply. You are quite correct that I will be using external power so the battery space will be free. The Adafruit chip you recommended is on it's way and will get tested when it arrives. I do not have any coding experience and will have to learn some I guess, a good opportunity while the components are on their way! Thanks again
Hi again, I've made some code that's supposed to do what you're asking for above (when you install the RTC chip on your Pro-Timer). However, I haven't had the possibility to test it, as I don't own the DS1307 myself, so I can guarantee with 99% certainty it will have unexpected bugs
Anyway! Here is a branch of my GitHub fork of Günthers code focusing on long term timelapses:
https://github.com/SimenZhor/LRTimelapse...Timelapses.
The main difference between this code and Günthers code is that it's got a new mode option called "daily schedule", which is supposed to be what you're looking for. This mode won't show up unless there's a RTC connected to the Arduino running the code. The other big difference is that my code saves variables in case of power loss. This isn't properly tested either, but should work to a certain extent. There are issues with this - mainly because I can't save any of the variables based on the millis() function (which is used to control the entire intervalometer right now) seeing as millis() return the time since the Arduino was turned on last time.
I've also noticed a few other problems you're gonna face in your long term project (some of these are probably worthy of noting for you too Günther):
- millis() will overflow after about 50 days, making the intervalometer stop completely in the current build.
- If you have short intervals, the imageCount variable will overflow too. I've changed it from int to long, meaning it won't overflow before it has taken 2^31 = 2147483647 pictures (as compared to 2^15 = 32768 before), so you're probably fine. But in the 0.88 version, using ints, a long term project like this might actually be at a teeny tiny risk of overflow.
The first of those two issues will need to be handled manually for now (by resetting the Arduino when it's outside the scheduled period. It should start where it left in the code I linked, so this shouldn't be a problem), or the entire code needs to be rid of the millis() function. The last option is the best one, but that means the code will be completely reliant on the DS1307 RTC chip, something I don't want to do unless the official project also makes this upgrade.
About that chip. In the code I linked the RTC chip is supposed to read the time of the compiler when the code is being uploaded. I have no idea if this works as flawlessly as the libraries made it seem, so keep this in mind when testing. You might have to sync the clock more manually, see
this for further instructions. When it comes to the wiring, it seems the DS1307 just needs four cables, two being 5v and gnd. The other two are the Analog 4 and Analog 5 pins marked "SDA" and "SCL" on the LCD shield.