Peripheral MyTime As TimeKeeperA @ 0 ' Set module number is 0 Dim CurYear As Byte ' Store the current value of year Dim CurMonth As Byte ' Store the current value of month Dim CurDay As Byte ' Store the current value of day Dim CurWeek As Byte ' Store the current value of weekday Dim CurHour As Byte ' Store the current value of hour Dim CurMinute As Byte ' Store the current value of minute Dim CurSecond As Byte ' Store the current value of second Dim SecondCnt As Byte ' Count the display time Sub Main() ' Main program MyTime.SetTimeAndDate(7, 9, 17, 15, 47, 0) ' Set the current time SecondCnt=0 MyTime.EnableSecondlyEvent() ' Enable the second event to be activated every second ' The following loop will be exited after time displayed at least 5 times. Do Loop Until SecondCnt>5 MyTime.DisableSecondlyEvent() ' Cancel the second Event MyTime.SetMinute(48) ' Set the minute to 48 MyTime.SetSecond(55) ' Set the second to 55 MyTime.SetHourlyAlarm(0, 49) ' Set Alarm #0 with a notification at 49 minutes in every hour SecondCnt=0 MyTime.HourlyAlarmOn(0) ' Activate Alarm #0 for hourly notifications. ' The following loop will be exited only when the hourly notification is activated. Do Loop Until SecondCnt>0 MyTime.HourlyAlarmOff(0) ' Disable the hourly notification of Alarm 0 MyTime.SetCountDownTimer(0, 0, 0, 0, 3) ' Set Timer #0 for the count down of 3 seconds SecondCnt=0 MyTime.CountDownTimerOn(0) ' Activate Timer #0 to execute the count down operation ' The following loop will be exited only when the count down operation is completed Do Loop Until SecondCnt>0 MyTime.CountDownTimerOff(0) ' Disable Timer #0 End Sub Event MyTime.SecondlyEvent() MyTime.GetTimeAndDate(CurYear,CurMonth,CurDay,CurWeek,CurHour,CurMinute,CurSecond) ' Get the current time Debug CurYear, "/", CurMonth, "/", CurDay, " ", CurHour, ":", CurMinute, ":", CurSecond, CR SecondCnt+=1 End Event Event MyTime.HourlyAlarm0Event() Debug "It is 49 minutes now.", CR SecondCnt+=1 End Event Event MyTime.CountDownTimer0Event() Debug "Count down 3 seconds.", CR SecondCnt+=1 End Event