Forum
Franzis Microcontoler ohne PC Betreiben?? (Elektronik)
Besser???
.include "tn13def.inc" ;soll 'ne lampe werden
rjmp anf
anf: ;anfang
sbi ddrb,3 ;3=ausgang
los:
nop
rjmp an ;Springe nach an
aus:
rcall war
rcall war
rcall war
rcall war
sbic pinb,4 ;taste getrückt?
rjmp an
rjmp aus
an:
sbi portb,3
rcall war
rcall war
cbi portb,3
sbic pinb,4 ;taste getrückt?
rjmp du
rjmp an
du: ;dunkel
rcall war
rcall war
dudu:
sbi portb,3
nop
cbi portb,3
nop
nop
nop
nop
nop
sbic pinb,4 ;taste getrückt?
rjmp hll
rjmp dudu
hll: ;etwas heller
rcall war
rcall war
hl:
cbi portb,3
nop
nop
sbic pinb,4 ;taste getrückt?
rjmp blin
rjmp dudu
blin: ;blinken
sbi portb,3
rcall war
cbi portb,3
rcall war
sbic pinb,4 ;taste getrückt?
rjmp lang
rjmp blin
lang: ;langsam blinken
rcall war
rcall war
sbi portb,3
rcall war
rcall war
cbi portb,3
sbic pinb,4
rjmp aus
rjmp lang
war: ;warteschleife
ldi r16,250
w1: ;1. Warteschl.
ldi r17,250
w2: ;2. Warteschl.
ldi r18, 1
w3: ;3. Warteschl
dec r18
brne w3
dec r17
brne w2
dec r16
brne w1
ret
Gesamter Thread:
