Using Propeller RTC emulator
Lev
Posts: 182
I am trying to return current hours, minutes, and seconds from the Propeller_RTC_Emulator to my spin program as separate values. I believe the varaibles are HH, MM, and SS in the RTC emulator. I have been unable to get any value for these variable, other than a zero. Does anyone know how to return these separate values from the RTC emulator? Here is the relevant section of code calling the RTC.
'Main Loop
repeat
Clock.ParseDateStamp(@DateStamp) 'get date and time stamps from RTC emulator
Clock.ParseTimeStamp(@TimeStamp)
' **** need something here?????
mission_time := HH*3600 + MM*60 +SS 'calculate mission time in seconds from RTC emulator
LocLong := (LocLongDeg*60) + LocLongMin 'calculate minutes of longitude
LocLat := (LocLatDeg*60) +LocLatMin 'calculate minutes of latitude
'Main Loop
repeat
Clock.ParseDateStamp(@DateStamp) 'get date and time stamps from RTC emulator
Clock.ParseTimeStamp(@TimeStamp)
' **** need something here?????
mission_time := HH*3600 + MM*60 +SS 'calculate mission time in seconds from RTC emulator
LocLong := (LocLongDeg*60) + LocLongMin 'calculate minutes of longitude
LocLat := (LocLatDeg*60) +LocLatMin 'calculate minutes of latitude
Comments
This is a bit of a hack. The TryParseTime method takes a pointer to the @TimeStamp and the time part you want to convert to an integer.
0 = Hour
1 = Minute
2 = Second