$regfile = "m88def.dat"
$crystal = 8000000

'Config Lcd stelt de Lcd poort pinnen in
Config Lcdpin = Pin , Db4 = Portb.2 , Db5 = Portb.3 , Db6 = Portb.4 , Db7 = Portb.5 , E = Portb.1 , Rs = Portb.0
Config Lcdbus = 4                                           'Selecteer 4 bits mode
Config Lcd = 16 * 2                                         '16*2 type LCD display
'U kunt uw eigen LCD karakters maken met het Deflcdchar commando
'Gebruik hiervoor de Bascom LCD Designer, Tools -> LCD Designer menu
Cursor Off Noblink                                          'Geen cursor
                                       'Geen cursor

Cls                                                         'Dit maakt het scherm leeg

 Do
 Gosub Startsignaal                                         'portc.1
 Gosub Command                                              'portd.1
 Gosub Knipperled                                           'portc.2
 Gosub Relais1                                              'portd.2
 Gosub Relais2                                              'portd.3
 Gosub Relaisr3                                             'portc.3
 Gosub Groenknipperled                                      'portc.5
 Gosub Relaisr4                                             'portc.4
 Gosub Groenknipperled2                                     'portc.5
 Gosub Bascom2                                              'portc.0
 Loop



 Startsignaal:
   If Portc.1 = 1 Then Locate 1 , 1 : Lcd "startsignaal"
  Waitms 500
  Return

  Command:
  Cls
  Waitms 500

  If Portd.1 = 1 Then Locate 1 , 1 : Lcd "command"
   Waitms 500
   Return

   Knipperled:
     Cls
  Waitms 500
  If Portc.2 = 1 Then Locate 1 , 1 : Lcd "rood knipper"
  Locate 2 , 1 : Lcd "led"
  Waitms 500
  Return


   Relais1:
   Waitms 500
  Cls

  If Portd.2 = 1 Then Locate 1 , 1 : Lcd "relais 1"
   Waitms 500
   Return

   Relais2:
   Waitms 500
  Cls
  If Portd.3 = 1 Then Locate 1 , 1 : Lcd "Relais2"
  Waitms 500
  Return


  Relaisr3:
  Waitms 500
  Cls
    If Portc.3 = 1 Then Locate 1 , 1 : Lcd "relais R3"
  Waitms 500

  Return

  Groenknipperled:
  Waitms 500
  Cls
    If Portc.5 = 1 Then Locate 1 , 1 : Lcd "groene"
  Locate 2 , 1 : Lcd "led"
  Waitms 500

  Return

  Relaisr4:
  Waitms 500
  Cls
  If Portc.4 = 1 Then Locate 1 , 1 : Lcd "relais R3"
  Waitms 500
    Return

     Groenknipperled2:
     If Portc.5 = 1 Then Locate 1 , 1 : Lcd "reset"
   Locate 2 , 1 : Lcd "led"
   Waitms 500
   Cls
   Return

     Bascom2:
    If Portc.0 = 1 Then Locate 1 , 1 : Lcd "signaal 2"
   Locate 2 , 1 : Lcd "bascom 2"
   Waitms 500
   Cls
   Return

  End




