home *** CD-ROM | disk | FTP | other *** search
- '**************************************
- '
- ' C-Control/BASIC WUERFEL1.BAS
- '
- ' Aufgabe: Wuerfelsteuerung mit 7 LEDs:
- '
- ' D1 D5
- '
- ' D2 D4 D6
- '
- ' D3 D7
- '
- ' Starttaste = D9
- '
- '**************************************
-
- ' --- Dekarationen --------------------
-
- define Ausgabe Byteport[1]
- define Starttaste port [9]
- define Zufall word
- define Wuerfelzahl byte
- define Eins &B00001000
- define Zwei &B00100010
- define Drei &B00101010
- define Vier &B01010101
- define Fuenf &B01011101
- define Sechs &B01110111
-
- '---- Programmanweisungen -------------
-
- #loop1
- #loop2
- if Starttaste = ON then goto loop2
- Zufall = Zufall + 1
- Wuerfelzahl = Zufall mod 6 + 1
- if Wuerfelzahl = 1 then Ausgabe = Eins
- if Wuerfelzahl = 2 then Ausgabe = Zwei
- if Wuerfelzahl = 3 then Ausgabe = Drei
- if Wuerfelzahl = 4 then Ausgabe = Vier
- if Wuerfelzahl = 5 then Ausgabe = Fuenf
- if Wuerfelzahl = 6 then Ausgabe = Sechs
- goto loop1
-
-
-
-
-
-
-