GETKBD()


Witam
Tym razem problem z matrycową klawiaturą.

$regfile = "m8def.dat"
$crystal = 11059200                                       
 
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portb.0 , Db5 = Portb.1 , Db6 = Portb.2 , Db7 = Portb.3 , E = Portb.4 , Rs = Portb.5
 
 
Cursor Off
Config Kbd = Portd , Delay = 100
 
Dim K As Byte
 
Dim P1 As Byte
Dim P2 As Byte
 
Dim S1 As Byte
Dim S2 As Byte
 
Dim Z1 As Byte
Dim Z2 As Byte
Cls
P1 = 12
P2 = 15
S1 = 4
S2 = 5
Z1 = 0
Z2 = 0
Do
K = Getkbd()
 
Waitms 100
 
 
If K = 9 Then Incr P1
If K = 8 Then Decr P1
If P1 = 10 Then P1 = 0
If P1 = 255 Then P1 = 9
 
 
If K = 2 Then Incr P2
If K = 3 Then Decr P2
If P2 = 10 Then P1 = 0
If P2 = 255 Then P1 = 9
 
 
 
If K = 10 Then Incr S1
If K = 11 Then Decr S1
If S1 = 10 Then S1 = 0
If S1 = 255 Then S1 = 9
 
 
 
If K = 1 Then Incr S2
If K = 0 Then Decr S2
If S2 = 10 Then S2 = 0
If S2 = 255 Then S2 = 9
 
 
 
'If K = 5 Then Incr Z1
'If K = 4 Then Decr Z1
 
 
'If K = 6 Then Incr Z2
'If K = 7 Then Decr Z2
 
 
 
Lcd " P1= " ; P1 ; "  P2= " ; P2
Lowerline
Lcd " S1= " ; S1 ; "   S2= " ; S2
 
Loop
 
End

Działają tylko S1 ( up i down ) oraz S2 (up i down ).
Co może być tego przyczyną ?

Już wiem, źle podłączony LCD.