Hi I'm a newbee..
I'm using the RTC DS1307 for my final year project. The below codes are, to get the time. However when I restart the board it goes back to the time, when I uploaded the program. It does not even keep the time when it last disconnected. I need to have the correct timing whenever I restart or connect the power supply.
I need some urgent help on this... pleeeeeeeaseee..
Thank you so much in advance...
void loop(){
now = rtc.now(); // Get the current time
int h = now.hour(); // Get the hours right now and store them in an integer called h
int m = now.minute(); // Get the minutes right now and store them in an integer called m
int s = now.second(); // Get the seconds right now and store them in an integer called
}
I have coppied only the codes related to RTC module
thank you for the reply..
I have already tried that Im getting error saying
'no matching function for call to RTC_Millis::begin()'
What do you think about the breakout board. It's different compared to adafruit and sparkfun ones. I'm a bit worried about this.
I've tried using
RTC_DS1307 rtc;
rtc.begin()
This just displays 06.28 whenever I upload the programme..
I used the above code as well.. But there is no change in it.. would you mind to share the link for the new version please..
I have downloaded many many libraries for the RTC do you think that would cause any problem.. I tried the other exa,ples.. one uses the internal clock, sive me outpit in the serial monitor.. But other two examples does not give me any output..
OMG!!!!!!!!
i just removed the connetions for the real time clock from the arduino.. and it works as the same.. which means i was not using the \RTC breakout board at all...
how do I check my RTC DS1307.. I'm very confused...
Please help me... =( =( =(
Well if it were me I would forget about libraries and just write to the device.
But then that's me. Get hold of the data sheet and just use the I2C commands to read and write to the registers.
I got the library from here:-
how do I check my RTC DS1307..
The best way is with an oscilloscope but I don't suppose you have one do you?
Get an I2C scanner and see what addresses it sees to check that you can see the chip.
There is 56 bytes of RAM in the chip so I would write to that and see if it reads back correctly.