-
-
Neuer Benutzer
Öfters hier
So, also so ists jeztz richtig.
; Ampel steuerung mit ATMega 8
.include "m8def.inc"
.def temp = r16
.def uZahl = r17
.def mZahl = r18
.def oZahl = r19
ldi temp, Low(RAMEND)
out SPL, temp
ldi temp, high(RAMEND)
out SPH, temp ;Stack Pointer Intialisieren
ldi temp, 0xff
out DDRB, temp ;Port B ist ausgang
Main:
ldi temp, 0b110110 ;Rot - Rot
out PortB, temp
ldi oZahl, 25
rcall delay
ldi temp, 0b110100 ;Rot - Rot Gelb
out PortB, temp
ldi oZahl, 25
rcall delay
ldi temp, 0b110011 ;Rot - Grün
out PortB, temp
ldi oZahl, 200
rcall delay
ldi temp, 0b110101 ;Rot - Gelb
out PortB, temp
ldi oZahl, 25
rcall delay
ldi temp, 0b110110 ;Rot - Rot
out PortB, temp
ldi oZahl, 25
rcall delay
ldi temp, 0b100110 ;Rot Gelb - Rot
out PortB, temp
ldi oZahl, 25
rcall delay
ldi temp, 0b1011110 ;Grün - Rot
out PortB, temp
ldi oZahl, 200
rcall delay
ldi temp, 0b101110 ;Gelb - Rot
out PortB, temp
ldi oZahl, 25
rcall delay
rjmp main
delay: ;Delay
ldi mZahl, 209
delay_:
ldi uZahl, 0xff
delay__:
dec uZahl
brne delay__
dec mZahl
brne delay_
dec oZahl
brne delay
ret
Berechtigungen
- Neue Themen erstellen: Nein
- Themen beantworten: Nein
- Anhänge hochladen: Nein
- Beiträge bearbeiten: Nein
-
Foren-Regeln
Lesezeichen