Moin
danke für deine schnelle Antwort, ich habe versucht das was du sagst umzusetzten aber irgentwie haut das nicht so richtig hin, ich hoffe die Ansätze sind wenigstens richtig
mfg Hübi
Code:
'--------------------------------------------------------------
$regfile = "attiny2313.dat" '
$crystal = 1000000 'Quarz: 1,0 MHz
'******** Deklarationen ********
Dim A As Word
'******** Initialisierung ******** '
Enable Int0
Enable Interrupts
On Int0 Taste0int
Ddrb = &B11111111 ' port B als Ausgang
Ddrd = &B0100000 ' pin D2 asl eingang
Portd.2 = 1 ' interne pullup widerstände aktivieren
'******** Hauptprogramm ********
Do
If Pind.2 = 0 Then Portb = &B10001000
Wait 1
A = A + 1
If A > 1770 Then
Portb = &B11000000
End If
If A > 1800 Then
Portb = &B00000000
End If
Loop
'******** Unterprogramme ********
Taste0int:
A = 0
End
Lesezeichen