PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Was mache ich Falsch Hilfe!!!!!!!



iq250
28.12.2005, 16:09
Habe einen Mega16 ,dort ist eine Tastaturmatrix an PB0 bis PB7
angeschlossen und möchte über int0 eine interrupt auslösen.
Bei der Simulation springt das Programm immer zu anfang zurück.
Ich glaube es liegt an der keyboard anweisung wie kann ich das aber umgehen?

$regfile = "m16def.dat"
$crystal = 16000000
Config Kbd = Portb
Enable Interrupts
Disable Int2
On Int0 Stoptaste
Dim A As Byte
Dim B As Byte
Los:
A = A + 1
B = Getkbd()
Print A
Goto Los
Stoptaste:
Print "hallo"
Return

Vitis
29.12.2005, 00:05
$regfile = "m16def.dat"
$crystal = 16000000

Config Kbd = Portb , Debounce = 30
Enable Interrupts
Disable Int2
Enable Int0
On Int0 Stoptaste
Dim A As Byte
Dim B As Byte

Do
Incr A
B = Getkbd()
Print A ; " " ; B
Loop
End


Stoptaste:
Print "hallo"
Return