'****************************************************************
'*  Name    : Belichtingsbaktimer.BAS                           *
'*  Author  : Coenen Stijn [Stynus]                             *
'*  Notice  : Licenced under Creative Commons                   *
'*          : Attribution-Noncommercial 2.0 Belgium Licence     *
'*          : http://creativecommons.org/licenses/by-nc/2.0/be/ *
'*  Date    : 14/01/2007                                        *
'*  Version : 3.0                                               *
'****************************************************************
Device 16F627
Config   WDT_OFF, PWRTE_ON, LVP_OFF, MCLRE_ON, INTRC_OSC_NOCLKOUT
Declare         LCD_INTERFACE 4
Declare         LCD_LINES 2
Symbol Lampen = PORTA.2
Symbol Start =  PORTB.0
Dim hondert As Byte
Dim seconden As Byte
Dim minuten As Byte
hondert     = 0
seconden    = 0
minuten     = 0
Cls
DelayMS 500

Print At 1,1, "C Elek"
Print At 2,1, "Stynus"
DelayMS 1000
Print At 1,1, "      "
Print At 2,1, "      "
Print At 2,1, "0 :0 :00"
GoTo Begin
Begin:
Print At 1,1, "OFF"
If Start = 1 Then
    bla:
    DelayMS 50
    If Start = 1 Then
        GoTo bla
    End If
    If Start = 0 Then
        High Lampen
        GoTo Loop:
    End If
End If
GoTo Begin

Loop:
Print At 1,1, "ON "
Loop2:

If Start = 1 Then
         DelayMS 50
    bla2:
    If Start = 1 Then
        GoTo bla2
    End If
    If Start = 0 Then
        Low Lampen
            hondert     = 0
            seconden    = 0
            minuten     = 0         
        GoTo Begin
   End If
End If
'tijd op Lcd:
DelayMS 3.98
hondert = hondert + 1
If hondert = 100 Then
    hondert = 0
    seconden = seconden + 1
End If
If seconden = 60 Then
    seconden = 0
    minuten = minuten + 1
End If
Print At 2,1,"  :  :"
Print At 2,1,@minuten
Print At 2,4,@seconden
Print At 2,7,@hondert
GoTo Loop2   
End