In-depth question on experiment 30 (Real-time clock)
Hi all,
After looking at the DS1302 data sheet, I understand the BS2 user
list. However, on line by line code examination, there are a few
lines I don't understand:
1.) the lines of code in the GoBack subroutine:
rawtime = rawtime + (btnMin * 1439)
rawtime = rawtime + (btnHrs * 1380)
day = (day + (btnDay * 6)) // 7
I like to know how those equations came about.
2.) The setRawtime subroutine lines.
Any input would be appreciated.
Sincerely,
RP
After looking at the DS1302 data sheet, I understand the BS2 user
list. However, on line by line code examination, there are a few
lines I don't understand:
1.) the lines of code in the GoBack subroutine:
rawtime = rawtime + (btnMin * 1439)
rawtime = rawtime + (btnHrs * 1380)
day = (day + (btnDay * 6)) // 7
I like to know how those equations came about.
2.) The setRawtime subroutine lines.
Any input would be appreciated.
Sincerely,
RP