I have a new DS1307 (original, not a Chinese rip off), with a new battery. It is working great, but when I turn the Arduino off (it is currently connected to laptop) and then turn it back on, it resets the time.
The line that sets the time is (in setup part of code):
setDS1307time(30, 42, 21, 4, 26, 11, 14);
So, when the Arduino gets the power back it runs the program again and it overrides the correct current time.
How can I avoid this?