26.10.2012 Aufrufe

Schrankensteuerung für Modellbahn

Schrankensteuerung für Modellbahn

Schrankensteuerung für Modellbahn

MEHR ANZEIGEN
WENIGER ANZEIGEN

Erfolgreiche ePaper selbst erstellen

Machen Sie aus Ihren PDF Publikationen ein blätterbares Flipbook mit unserer einzigartigen Google optimierten e-Paper Software.

NULL_STELLUNG:<br />

sbis PinB,0 ;Lichtschranke1<br />

rjmp VOR_MAIN<br />

sbis PinB,1 ;Lichtschranke2<br />

rjmp VOR_MAIN ;Lichtschrankenabfrage:<br />

ldi Schritte, 1 ;bei 1 Signal Lichtschranken nicht durchbrochen<br />

rcall MOTOR_RUNTER ;also sind die Schranken noch nicht unten<br />

rjmp NULL_STELLUNG ;bei 0 Signal Schaltung betriebsbereit<br />

;_______________________________________________________________________________<br />

MOTOR_HOCH:<br />

ldi Motor, 0b00101100 ;\<br />

out PortD, Motor ; |<br />

ldi Zeit, 1 ; |<br />

rcall WARTE ; |<br />

; |<br />

ldi Motor, 0b00110100 ; |<br />

out PortD, Motor ; |<br />

ldi Zeit, 1 ; |<br />

rcall WARTE ; |<br />

; |<br />

ldi Motor, 0b01010100 ; |<br />

out PortD, Motor ; |<br />

ldi Zeit, 1 ; |<br />

rcall WARTE ; \ Ansteuerung um die Schrittmotoren<br />

; / nach oden zu steuern<br />

ldi Motor, 0b01001100 ; |<br />

out PortD, Motor ; |<br />

ldi Zeit, 1 ; |<br />

rcall WARTE ; |<br />

; |<br />

dec Schritte ; |<br />

cp Schritte, null ; |<br />

brne MOTOR_HOCH ; |<br />

; |<br />

ldi Motor, 0b01111100 ; |<br />

out PortD, Motor ; |<br />

ret ;/<br />

;_______________________________________________________________________________<br />

Seite 19

Hurra! Ihre Datei wurde hochgeladen und ist bereit für die Veröffentlichung.

Erfolgreich gespeichert!

Leider ist etwas schief gelaufen!