Versuch1: $regfile = "8515def.dat" Ddra = &HFF Porta = &HFF ' PullUp aktiv Ddrb = &HFF Config Portc = Output 'Port als Output Portc = &HFF Dim Column As Byte Dim Row As Byte Dim Key As Byte ' Tastenvariable Declare Function Query_matrix() As Byte Do Key = Query_matrix() ' Abfrage der gelesenen Taste If Key <> 0 Then Portc = Key Wait 1 Key = 8 Portc = Key End If Loop End Function Query_matrix() As Byte Key = 0 For Column = 0 To 4 Portb = $b00011111 If Column = 0 Then Reset Portb.0 If Column = 1 Then Reset Portb.1 If Column = 2 Then Reset Portb.2 If Column = 3 Then Reset Portb.3 If Column = 4 Then Reset Portb.4 For Row = 5 To 9 Select Case Row Case 5 : Debounce Pina.4 , 0 , Calc_key , Sub Case 6 : Debounce Pina.3 , 0 , Calc_key , Sub Case 7 : Debounce Pina.2 , 0 , Calc_key , Sub Case 8 : Debounce Pina.1 , 0 , Calc_key , Sub Case 9 : Debounce Pina.0 , 0 , Calc_key , Sub End Select Next Next Query_matrix = Key End Function Query_matrix() Calc_key: Select Case Row Case 5 : Key = Column + 1 Case 6 : Key = Column + 6 Case 7 : Key = Column + 11 Case 8 : Key = Column + 16 Case 9 : Key = Column + 21 End Select Return Versuch2: $regfile = "8515def.dat" Config Kbd = Porta Config Portb = Output Config Portc = Output Portc = &HFF Dim Value As Byte Do Value = Getkbd() Portb = Not Value Portc = Value Loop End