$regfile = "m8def.dat" $crystal = 12000000 $baud = 19200 Osccal = &HAF Config Com1 = Dummy , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0 $hwstack = 32 $swstack = 24 $framesize = 32 Dim A As Byte Dim B As Byte Dim C As Byte Dim I As Byte Dim Temp As Byte Dim Mine As Byte Dim Seca As Byte Dim E(12) As Byte Dim Car(6) As Byte Dim Player(6) As String * 6 Const Erk = &H92 'Start_Ende Byte Const A_b = &H93 Const _reset = &H11 ' Config_bytes Const Round_info = &H12 Const Time_info = &H13 Const Car_info = &H14 Const Player_info = &H15 Const Play_modus = &H16 Const Status_info = &H17 Const Start_race = &H21 'status bytes Const Grand_prix = &H22 Const Endurance = &H23 Const Rally = &H24 Const Pursuit = &H25 Const Nascar = &H26 Const Arcade = &H27 Const Qualify = &H28 Const Green_led_on = &H2A Const _stop = &H2F Const Get_in_1 = 1 Const Get_out_1 = 2 Const Get_in_2 = 3 Const Get_out_2 = 4 Config Serialin = Buffered , Size = 20 Config Portb = Output Open "comd.6:19200,8,N,1" For Input As #1 'Startampel Open "comd.7:19200,8,N,1" For Output As #2 Open "comd.4:19200,8,N,1" For Input As #3 'Startampel Open "comd.5:19200,8,N,1" For Output As #4 Enable Interrupts Declare Sub Write_startampel(byval Per As Byte , Byval B2 As Byte , Byval B3 As Byte , Byval B4 As Byte , Byval B5 As Byte , Byval B6 As Byte , Byval B7 As Byte , Byval B8 As Byte) B = &B10101010 Print #2 , "Programm gestartet" Print #4 , "Progamm Portc" For I = 1 To 6 Car(i) = I Next Do Call Write_startampel(2 , Status_info , Start_race , 0 , 0 , 0 , 0 , 0) Call Write_startampel(2 , Play_modus , Grand_prix , 0 , 0 , 0 , 0 , 0) Call Write_startampel(2 , Round_info , 0 , Car(3) , 0 , 0 , 0 , &H01) Waitms 10 'Call Write_startampel(2 , Time_info , 0 , Car(4) , &H12 , &HB4 , &HA8 , 0) '1225896 'Waitms 20 'Call Write_startampel(2 , Time_info , 0 , Car(4) , &H12 , &HB8 , &HD3 , 0) '1226963 'Waitms 15 'Call Write_startampel(2 , Time_info , 0 , Car(4) , &H12 , &HBC , &HFE , 0) '1228030 Wait 1 Portb = B Rotate B , Left 'Print #4 , "Kann man das lesen" Loop Sub Write_startampel(byval Per As Byte ; Byval B2 As Byte , Byval B3 As Byte , Byval B4 As Byte , Byval B5 As Byte , Byval B6 As Byte , Byval B7 As Byte , Byval B8 As Byte) Printbin #2 , Erk 'Byte1 Printbin #2 , B2 'Byte2 Printbin #2 , B3 'Byte3 Printbin #2 , B4 'Byte4 Printbin #2 , B5 'Byte5 Printbin #2 , B6 'Byte6 Printbin #2 , B7 'Byte7 Printbin #2 , B8 'Byte8 Printbin #2 , A_b 'Byte9 End Sub