BASCOM INT0 / 1 beide drücken Variable

Gast #1466598
Lesenswert?

Hab momeentan:
$regfile = "m8def.dat"                                      'ATmega8
$crystal = 4000000
 Config Int0 = Rising
 Config Int1 = Rising
 Enable Interrupts
 Enable Int0
 Enable Int1
 On Int0 Isr_von_int0
 On Int1 Isr_von_int1
                                              '4 MHz
Config Portc = Output
Config Portd.4 = Output
config portd.2 = Input
Config Portd.3 = Input
Portd.2 = 1
Portd.3 = 1

Dim An As Bit
Dim Vcc As Bit
Dim A As Bit
Do

If A = 0 Then
 Gosub Sub1
Else
Gosub Sub2
End If
Loop



 Isr_von_int0:
 Set A
 Return

  Isr_von_int1:
  Reset A
 Return

Sub1:

Portd.4 = 0
Portc.4 = 1
Portc.2 = 1
Portc.1 = 1
Wait 2
Portd.4 = 1
Portc.4 = 0
Portc.2 = 0
Portc.1 = 0
Wait 2

Return
Sub2:

Portd.4 = 0
Portc.0 = 1
Portc.3 = 1
Portc.5 = 1
Wait 2
Portd.4 = 1
Portc.5 = 0
Portc.3 = 0
Portc.0 = 0
Wait 2

Return


Nun die Frage:

Wie schreib ich es am besten das, wenn beide Taster gedrückt sind, er 
mir eine andere SUB aufruft?

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren