You can find the "final" version in the code examples section:
http://www.picbasic.co.uk/forum/show...=3041#post3041
regards:
Ralph
You can find the "final" version in the code examples section:
http://www.picbasic.co.uk/forum/show...=3041#post3041
regards:
Ralph
I can't seem tp follow the variable delaration of the programOriginally Posted by Melanie
Can i use this with my DS1307 RTC
i can read YEAR, MONTH and DAY from my RTC what variable to i send them to before calling the sub.
i am confused here
Isaac
Hi Nav / Mel
I have being reading the trend DS1994 Memory/Time iButton and it is very very interesting and just need your help in using the program.
I am using a DS1307 RTC of which i read the following variables
Date =23
Month=03
Year=05
Hour =21
Mins =30
Seconds=30
to give me 23-03-05 21:30:30 (my data & time)
which are all byte variables
But i want to convert this to Linear DAYS and add 365 but can't figure out which subroutine to use as from my understand the subroutines are looking for a 32bit number
Could you be kind enough to explain to me
Best Regards
Isaac
ISAAC,
the Subroutine "CalculateLinearFromDate" isn't really that complex, is it?
with your variables beeing:
Date =23
Month=03
Year=05
Hour =21
Mins =30
Seconds=30
all you need to do is:
rename your VAR "Date" to "DAY"
(or create an alias)
and declare the following variables in addition:
CounterA VAR Byte
TempA VAR WORD
TempB VAR WORD
DAYS WAR WORD
once you have read the DS1307 just
GOSUB CalculateLinearFromDate
and you will find the result in "DAYS"
regards
Ralph
_______________________________________________
There are only 10 types of people:
Those who understand binary, and those who don't ...
_______________________________________________
Hi Ralph & Melanie,
How to calculate the elapsed hours between 16:30:45 (HH:MM:SS), 28/05/2005 (DD/MM/YYYY) and 02:26:38, 01/08/2004.
Assume the elapsed time is limited to less than one year. Can I use the CalculateLinearFromDate subroutine to do the job?
Best regards,
Yuantu Huang
CalculateLinearFromDate will account for the DAYS. Multiply by 24 for your TotalHours. Then to account for the Hours...
If EndDateHours > StartDateHours then TotalHours=TotalHours+(EndDateHours-StartDateHours)
If EndDateHours < StartDateHours then TotalHours=TotalHours-(StartDateHours-EndDateHours)
hi,Originally Posted by Melanie
i succeed to read ibutton (1990a) and display it on lcd..but iam not able to store serial# on variable..i want to compare ibutton's serial nos.iam trying to read multiple ibuttons and store their sr# in eprom.. if sr# is 1 of the stored # then do something...
Thanking you
Regards.
Bookmarks