$regfile = "m8535.dat" $crystal = 8000000 Config Portc.1 = Output 'Rot Config Portc.2 = Output 'Grün Config Portc.3 = Output 'Blau Config Portd.0 = Input 'Schalter 1 (Farbwechsel) Config Portd.1 = Input 'Schalter 2 (Rot) Config Portd.2 = Input 'Schalter 3 (Grün) Config Portd.3 = Input 'Schalter 4 (Flash) Do If Pind.0 = 1 Then Gosub Warten Else Gosub Aus 'Leute steigen ein (farbwechsel) If Pind.1 = 1 Then Set Portc.1 Else Reset Portc.1 'Einsteigen beendet (Türen Schließen sich) If Pind.2 = 1 Then Set Portc.2 Else Reset Portc.2 'Fahrt beginnt (fahrt läuft) If Pind.3 = 1 Then Gosub Flash Else Gosub Aus 'Turbomodus (Bypass offen) Loop Warten: Set Portc.1 Waitms 400 Reset Portc.1 Set Portc.2 Waitms 400 Reset Portc.2 Set Portc.3 Waitms 400 Reset Portc.3 Set Portc.1 Set Portc.2 Waitms 400 Reset Portc.1 Reset Portc.2 Set Portc.3 Set Portc.1 Waitms 400 Reset Portc.3 Reset Portc.1 Set Portc.2 Set Portc.3 Waitms 400 Reset Portc.2 Reset Portc.3 Set Portc.1 Set Portc.2 Set Portc.3 Waitms 400 Reset Portc.1 Reset Portc.2 Reset Portc.3 Return Flash: Set Portc.1 Set Portc.2 Set Portc.3 Waitms 50 Reset Portc.1 Reset Portc.2 Reset Portc.3 Waitms 50 Return Aus: Portc.1 = 0 Portc.2 = 0 Portc.3 = 0 Return