1 of 1 people found this helpful
I will recommend you to check these posts where other users have been debating and giving suggestions about the RTC on Galileo:
Let us know if those posts were helpful for you. Have a nice day!
Thanks for your input
"Real Time Clock
Most Linux boards rely on a connection to the Internet to get the current date and time. But with Galileo’s on-board RTC (real time clock), you’ll be able to track time even when the board is powered off. Just wire up a 3.0V coin cell battery to the board."
see this code.
system("date 010112002013"); //sets the date & time to 12:00 1st Jan 2013
system("date '+%H:%M:%S' > /home/root/time.txt"); //get current time in the format- hours:minutes:secs //and save in text file time.txt located in /home/root
fp = fopen("/home/root/time.txt", "r");
fgets(buf, 9, fp);
Serial.print("The current time is ");
working fine, but the only thing the I don´t like, the part on the "system("date 010112002013"); //sets the date & time to 12:00 1st Jan 2013" every time when restart the Intel Galileo, always I see the date & time begining at 12:00
or how to access the real time clock that runs on battery just put the pins indicated
Try to use system("date 010112002013"); just once (with the actual date). I mean, run a sketch to configure the date and then read it to make sure it is correct. Then, erase system("date 010112002013"); to avoid re-writing the date and directly read the date with system("date '+%H:%M:%S' > /home/root/time.txt"); to verify if the RTC is working fine.
Have a nice day!