Use of the PutTime and GetTime Commands

' Program Time_Blink.Bas
'
' Sets time to 12:00:00.0
'
' Continually winks LED and displays current time.
'
' Illustrates PutTime and GetTime
'
' copyright David Seebold, Baltimore, Sept, '99 

Sub Main()

   Dim Hour as Byte
   Dim Minute as Byte
   Dim Second as Single
   Dim Space as String

   Space = " "

   Call OpenSerialport(2,9600)

   Hour = 12	' set the time for 12:00:00.0
   Minute = 00
   Second = 0.0
   Call PutTime(Hour, Minute, Second)
	
   Do	' continual loop
      Call GetTime(Hour, Minute, Second)

      If (Hour <10)
         Call PutB(0)	' insert a leading 0
      Endif
      Call PutB(Hour)
      Call PutStr(Space) 

      If (Minute < 10) Then
         Call PutB(0)	' insert a leading zero
      Enedif

      Call PutB(Minute)
      Call PutStr(Space)

      If (Second < 10.0) Then
	 Call PutB(0)	' insert a leading zero
      End If
      Call PutS(Second)
      Call NewLine()		

      Call PutPin(14,bxOutputHigh)	' wink an LED
      Call Sleep(0.5)
      Call PutPin(14,bxOutputLow)	
      Call Sleep(0.5)
   Loop

End Sub