private Sub SettingAlarms
RTC.Initialize("rtc_Alarm",True)
dt(0) = Century '21st century (ie 2000)
dt(1) = Year 'year
dt(2) = Month 'month
dt(3) = Day 'day
'time .. 1:26pm (zero sec) (GMT)
dt(4) = Hour 'hour (0-23)
dt(5) = Minut 'minute
dt(6) = LCD_Index 'LCD_Indexs
dt(7) = 0 'not required.
RTC.SetClock(dt,0,0)
RTC.SetAlarm(1,RTC.Sec2DT(RTC.DT2Sec(dt)+(RTC.SECONDS_1DAY*Phase1_Period)))
RTC.SetAlarm(2,RTC.Sec2DT(RTC.DT2Sec(dt)+(RTC.SECONDS_1DAY*Phase2_Period)))
RTC.SetAlarm(3,RTC.Sec2DT(RTC.DT2Sec(dt)+5)) '''''''''''''''''''''''''just to say,i want to repeat this alarm with index 3
RTC.SetAlarm(4,RTC.Sec2DT(RTC.DT2Sec(dt)+(RTC.SECONDS_1MINUTE*30)))
RTC.SetAlarm(5,RTC.Sec2DT(RTC.DT2Sec(dt)+(RTC.SECONDS_1DAY)))
End Sub
private Sub rtc_Alarm(index As Byte)
Select index
Case 0
LED_Indicator.DigitalWrite(Not(LED_Indicator.DigitalRead))
Case 1
Current_Phase=2
Case 2
Current_Phase=3
'End Everyting here
Case 3
RTC.CancelAlarm(3)
RTC.SetAlarm(3,RTC.Sec2DT(RTC.DT2Sec(dt)+5)) '''''''''''' trying to repeat, but not working'
If Current_Phase<3 Then
TurnExhaustFanOn()
End If
Case 4
'Write EEPROM here
Case 5
DayPassed=DayPassed+1
End Select
End Sub