How to get DS1302 time & date in ASCII to scratch pad on BS2E ?
How can I get DS1302 time & date in ASCII to scratch pad on BS2E ?
If the Basic Stamp had string functions this would not be a problem.
I have the DS1302 & program running, with the time and date being
displayed with DEBUG.
I need to have the date and time written in ASCII characters,
either to the BS2E Scratch Pad, or to the RAM on the DS1302.
ASCII characters are a must for my application.
Can anyone help?
Thank you in advance for any help you can offer,
Michael
This is a code snippet from the program DS1302.BS2 by Jon Williams
ST1: DEBUG HOME ' home the debug cursor
FOR idx = 0 TO 2 ' get day name
Read (Day1+((day-1)*3)+idx), dyStr(idx)
NEXT
DEBUG STR dyStr\3, CR ' output day
DEBUG DEC mo10, DEC mo01, "/" ' output date
DEBUG DEC dt10, DEC dt01, "/"
DEBUG DEC yr10, DEC yr01, CR
DEBUG DEC hr10, DEC hr01, ":" ' output time
DEBUG DEC mn10, DEC mn01, ":"
DEBUG DEC sc10, DEC sc01, CR
oldSc = secs ' reset check value
EndST: RETURN
If the Basic Stamp had string functions this would not be a problem.
I have the DS1302 & program running, with the time and date being
displayed with DEBUG.
I need to have the date and time written in ASCII characters,
either to the BS2E Scratch Pad, or to the RAM on the DS1302.
ASCII characters are a must for my application.
Can anyone help?
Thank you in advance for any help you can offer,
Michael
This is a code snippet from the program DS1302.BS2 by Jon Williams
ST1: DEBUG HOME ' home the debug cursor
FOR idx = 0 TO 2 ' get day name
Read (Day1+((day-1)*3)+idx), dyStr(idx)
NEXT
DEBUG STR dyStr\3, CR ' output day
DEBUG DEC mo10, DEC mo01, "/" ' output date
DEBUG DEC dt10, DEC dt01, "/"
DEBUG DEC yr10, DEC yr01, CR
DEBUG DEC hr10, DEC hr01, ":" ' output time
DEBUG DEC mn10, DEC mn01, ":"
DEBUG DEC sc10, DEC sc01, CR
oldSc = secs ' reset check value
EndST: RETURN