so hab mal den Code hier mal reingestellt und BITTE um HILFE oder Tipps
Code:
'-----------------------------------------------
'Schaltung Für
'Klingel Privat - KatzenPension - Lichtschranke
'Eingänge: 2 x klingeltaster und Lichtschranke
'Ausgänge: 2 Klingeln über realis geschaltet
' Deverse Led`s zur anzeige
'-----------------------------------------------
$regfile "2313def.dat"
$crystal = 8000000
Config Lcdpin = Pin , Db4 = Portd.5 , Db5 = Portd.4 , Db6 = Portd.3 , _
Db7 = Portd.2 , E = Portd.1 , Rs = Portd.0
Config Lcd = 16 * 2
Initlcd
Cursor Blink
Config Portb.0 = Output 'Klingel P
Config Portb.1 = Output 'Klingel K
Config Portb.2 = Output
Config Portb.7 = Output 'Klingel B
Config Pinb.3 = Input 'Klingeltaster P
Portb.3 = 0
Config Pinb.4 = Input 'Klingeltaster K
Portb.4 = 0
Config Pind.6 = Input 'Lichtschranke
Portd.6 = 0
Declare Sub Klingelp
Declare Sub Klingelk
Declare Sub Lichtschranke
Dim I As Byte
Do
If Pinb.0 = 0 Then
Locate 1 , 2
Lcd " Klingelmelder"
If Pinb.3 = 0 Then Gosub Klingelp
If Pinb.4 = 0 Then Gosub Klingelk
If Pind.6 = 0 Then Gosub Lichtschranke
Loop
End If
Sub Klingelp
Portb = &B10000010
Waitms 500
Portb = &B00000000
Waitms 400
End Sub
Sub Klingelk
Portb = &B10000011
Waitms 100
Portb = &B10000000
Waitms 150
Portb = &B10000010
Waitms 100
Portb = &B10000001
Waitms 150
Portb = &B10000010
Waitms 100
Portb = &B10000000
Waitms 150
Portb = &B10000011
Waitms 100
Portb = &B00000000
Waitms 150
End Sub
Sub Lichtschranke
Portb = &B10000011
Waitms 200
Portb = &B10000010
Waitms 250
Portb = &B10000011
Waitms 200
Portb = &B10000000
Waitms 200
Portb = &B10000011
Waitms 200
Portb = &B10000010
Waitms 250
Portb = &B10000011
Waitms 200
Portb = &B00000000
Waitms 200
End Sub
End
Return
könnt ihr mir helfen
Gruß Der Bastler genannt auch ( Thorsten )
Lesezeichen