home *** CD-ROM | disk | FTP | other *** search
- '**************************************
- '
- ' C-Control/BASIC WUERFEL.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 Zahl byte
-
- '---- Programmanweisungen -------------
- randomize timer
- #loop1
- #loop2
- wait 2 'Entprellung
- if Starttaste = ON then goto loop2
- Ausgabe = OFF
- wait 2 'Entprellung
- #loop3
- wait 2 'Entprellung
- if Starttaste = OFF then goto loop3
- Zufall = rand
- print Zufall
- Zufall = ABS (Zufall)
- Zufall = Zufall mod 371
- print Zufall
- Zahl = Zufall mod 6
- print Zahl
- ' Tabelle 0...5
- looktab Bitmuster, Zahl, Ausgabe
- goto loop1
- end
-
- table Bitmuster
- &B00001000 &B00100010
- &B00101010 &B01010101
- &B01011101 &B01110111
- tabend
-
-
-
-
-