home *** CD-ROM | disk | FTP | other *** search
/ ifirobotics.com / www.ifirobotics.com.tar / www.ifirobotics.com / docs / isaac32-default-program.bsx < prev    next >
Text File  |  2007-12-18  |  17KB  |  497 lines

  1. ' PROGRAM:    2000 Default Code RevNC.bsx
  2. ' Written by: Innovation First, Inc.
  3. ' Date:       12/28/99
  4. '
  5. ' Define BS2-SX Project Files
  6. '
  7. ' {$STAMP BS2SX}
  8.  
  9.  
  10.  
  11.  
  12. '========== DECLARE VARIABLES ================================================
  13. '=============================================================================
  14. '  Below is a list of declared input and output variables.  Comment or un-comment
  15. '  the variables as needed.  Declare any additional variables required in
  16. '  your main program loop.  Note that you may only use 26 total variables.
  17.  
  18.  
  19. '---------- Operator Interface (OI) - Analog Inputs --------------------------
  20.  
  21. p1_x        VAR byte    'Port 1, X-axis on Joystick
  22. p2_x        VAR byte    'Port 2, X-axis on Joystick
  23. p3_x        VAR byte    'Port 3, X-axis on Joystick
  24. p4_x        VAR byte    'Port 4, X-axis on Joystick
  25.  
  26. p1_y        VAR byte    'Port 1, Y-axis on Joystick
  27. p2_y        VAR byte    'Port 2, Y-axis on Joystick
  28. p3_y        VAR byte    'Port 3, Y-axis on Joystick
  29. p4_y        VAR byte    'Port 4, Y-axis on Joystick
  30.  
  31. p1_wheel    VAR byte    'Port 1, Wheel on Joystick
  32. p2_wheel    VAR byte    'Port 2, Wheel on Joystick
  33. p3_wheel    VAR byte    'Port 3, Wheel on Joystick
  34. p4_wheel    VAR byte    'Port 4, Wheel on Joystick
  35.  
  36. 'p1_aux    VAR byte    'Port 1, Aux on Joystick
  37. 'p2_aux    VAR byte    'Port 2, Aux on Joystick
  38. 'p3_aux    VAR byte    'Port 3, Aux on Joystick
  39. 'p4_aux    VAR byte    'Port 4, Aux on Joystick
  40.  
  41.  
  42. '---------- Operator Interface - Digital Inputs ------------------------------
  43.  
  44. oi_swA    VAR byte    'OI Digital Switch Inputs 1 thru 8
  45. oi_swB    VAR byte    'OI Digital Switch Inputs 9 thru 16
  46.  
  47.  
  48. '---------- Robot Controller (RC) - Analog Inputs ----------------------------
  49.  
  50. 'sensor1    VAR byte    'RC Analog Input 1, connector pin 2
  51. 'sensor2    VAR byte    'RC Analog Input 2, connector pin 16
  52. 'sensor3    VAR byte    'RC Analog Input 3, connector pin 5
  53. 'sensor4    VAR byte    'RC Analog Input 4, connector pin 19
  54. 'sensor5    VAR byte    'RC Analog Input 5, connector pin 8
  55. 'sensor6    VAR byte    'RC Analog Input 6, connector pin 22
  56. 'sensor7    VAR byte    'RC Analog Input 7, connector pin 11
  57. 'bat_volt    VAR byte    'RC Analog Input 8, hardwired to the Battery
  58.                 'Vin = ((4.7/14.7)* Battery voltage)-0.4
  59.                 'Binary Battery Voltage = (Vin/5.0 V)*255
  60.  
  61.  
  62. '---------- Robot Controller - Digital Inputs --------------------------------
  63.  
  64. rc_swA    VAR byte    'RC Digital Inputs 1 thru 8
  65. rc_swB    VAR byte    'RC Digital Inputs 9 thru 16
  66.  
  67.  
  68. '---------- Robot Controller - Digital Outputs -------------------------------
  69.  
  70. relayA    VAR byte
  71. relayB    VAR byte
  72.  
  73.  
  74. '---------- Misc. ------------------------------------------------------------
  75.  
  76. PB_mode    VAR byte
  77. 'packet_num    VAR byte
  78. 'delta_t    VAR byte
  79.  
  80.  
  81.  
  82.  
  83. '========== DEFINE ALIASES ===================================================
  84. '=============================================================================
  85. '  Aliases are variables which are sub-divisions of variables defined
  86. '  above.  Aliases don't require any additional RAM.
  87.  
  88.  
  89. '---------- Aliases for each OI switch input ---------------------------------
  90. '  Below are aliases for the digital inputs located on the Operator Interface.
  91. '  Ports 1 & 3 have their inputs duplicated in ports 4 & 2 respectively.  The 
  92. '  inputs from ports 1 & 3 may be disabled via the 'Disable' dip switch 
  93. '  located on the Operator Interface.  See Users Manual for details.
  94.  
  95. p1_sw_trig    VAR oi_swA.bit0    'Joystick Trigger Button,    same as Port4 pin5 
  96. p1_sw_top    VAR oi_swA.bit1    'Joystick Top Button,        same as Port4 pin8
  97. p1_sw_aux1    VAR oi_swA.bit2    'Aux input,                same as Port4 pin9
  98. p1_sw_aux2    VAR oi_swA.bit3    'Aux input,                same as Port4 pin15
  99.  
  100. p3_sw_trig    VAR oi_swA.bit4    'Joystick Trigger Button,    same as Port2 pin5 
  101. p3_sw_top    VAR oi_swA.bit5    'Joystick Top Button,        same as Port2 pin8
  102. p3_sw_aux1    VAR oi_swA.bit6    'Aux input,                same as Port2 pin9
  103. p3_sw_aux2    VAR oi_swA.bit7    'Aux input,                same as Port2 pin15
  104.  
  105. p2_sw_trig    VAR oi_swB.bit0    'Joystick Trigger Button
  106. p2_sw_top    VAR oi_swB.bit1    'Joystick Top Button
  107. p2_sw_aux1    VAR oi_swB.bit2    'Aux input
  108. p2_sw_aux2    VAR oi_swB.bit3    'Aux input
  109.  
  110. p4_sw_trig    VAR oi_swB.bit4    'Joystick Trigger Button
  111. p4_sw_top    VAR oi_swB.bit5    'Joystick Top Button
  112. p4_sw_aux1    VAR oi_swB.bit6    'Aux input
  113. p4_sw_aux2    VAR oi_swB.bit7    'Aux input
  114.  
  115.  
  116. '---------- Aliases for each RC switch input ---------------------------------
  117. '  Below are aliases for the digital inputs located on the Robot Controller.
  118.  
  119. rc_sw1    VAR rc_swA.bit0
  120. rc_sw2    VAR rc_swA.bit1
  121. rc_sw3    VAR rc_swA.bit2
  122. rc_sw4    VAR rc_swA.bit3
  123. rc_sw5    VAR rc_swA.bit4
  124. rc_sw6    VAR rc_swA.bit5
  125. rc_sw7    VAR rc_swA.bit6
  126. rc_sw8    VAR rc_swA.bit7
  127. rc_sw9    VAR rc_swB.bit0
  128. rc_sw10    VAR rc_swB.bit1
  129. rc_sw11    VAR rc_swB.bit2
  130. rc_sw12    VAR rc_swB.bit3
  131. rc_sw13    VAR rc_swB.bit4
  132. rc_sw14    VAR rc_swB.bit5
  133. rc_sw15    VAR rc_swB.bit6
  134. rc_sw16    VAR rc_swB.bit7
  135.  
  136.  
  137. '---------- Aliases for each RC Relay outputs ---------------------------------
  138. '  Below are aliases for the relay outputs located on the Robot Controller.
  139.  
  140. relay1_fwd    VAR RelayA.bit0
  141. relay1_rev    VAR RelayA.bit1
  142. relay2_fwd    VAR RelayA.bit2
  143. relay2_rev    VAR RelayA.bit3
  144. relay3_fwd    VAR RelayA.bit4
  145. relay3_rev    VAR RelayA.bit5
  146. relay4_fwd    VAR RelayA.bit6
  147. relay4_rev    VAR RelayA.bit7
  148.  
  149. relay5_fwd    VAR RelayB.bit0
  150. relay5_rev    VAR RelayB.bit1
  151. relay6_fwd    VAR RelayB.bit2
  152. relay6_rev    VAR RelayB.bit3
  153. relay7_fwd    VAR RelayB.bit4
  154. relay7_rev    VAR RelayB.bit5
  155. relay8_fwd    VAR RelayB.bit6
  156. relay8_rev    VAR RelayB.bit7
  157.  
  158.  
  159. '---------- Aliases for the Pbasic Mode Byte (PB_mode) -----------------------
  160. '  The last bit of the PB_mode byte (aliased as comp_mode) indicates the status
  161. '  of the Competition Control, either Enabled or Disabled.  This indicates the
  162. '  starting and stopping of rounds at the competitions.  Comp_mode is the same
  163. '  as the "Disabled" LED on the Operator Interface.
  164. '  Comp_mode = 1 for Enabled, 0 for Disabled.
  165.  
  166. comp_mode        VAR PB_mode.bit7
  167.  
  168.  
  169.  
  170.  
  171. '========= DEFINE CONSTANTS FOR INITIALIZATION ===============================
  172. '=============================================================================
  173. '  The initialization code is used to select the input data used by PBASIC.
  174. '  The Master micro-processor (uP) sends the data you select to the BS2SX
  175. '  PBASIC uP.  You may select up to 26 constants, corresponding
  176. '  to 26 variables, from the 32 available to you.  Make sure that you have 
  177. '  variables for all the bytes recieved in the serin command.
  178. '
  179. '  The constants below have a "c_" prefix, as compared to the variables that 
  180. '  they will represent.
  181. '
  182. '  Set the Constants below to 1 for each data byte you want to recieve.
  183. '  Set the Constants below to 0 for the unneeded data bytes.
  184.  
  185.  
  186. '---------- Set the Initialization constants you want to read ----------------
  187.  
  188. c_p1_y        CON    1
  189. c_p2_y        CON    1
  190. c_p3_y        CON    1
  191. c_p4_y        CON    1
  192.  
  193. c_p1_x        CON    1
  194. c_p2_x        CON    1
  195. c_p3_x        CON    1
  196. c_p4_x        CON    1
  197.  
  198. c_p1_wheel        CON    1
  199. c_p2_wheel        CON    1
  200. c_p3_wheel        CON    1
  201. c_p4_wheel        CON    1
  202.  
  203. c_p1_aux        CON    0
  204. c_p2_aux        CON    0
  205. c_p3_aux        CON    0
  206. c_p4_aux        CON    0
  207.  
  208. c_oi_swA        CON    1
  209. c_oi_swB        CON    1
  210.  
  211. c_sensor1        CON    0
  212. c_sensor2        CON    0
  213. c_sensor3        CON    0
  214. c_sensor4        CON    0
  215. c_sensor5        CON    0
  216. c_sensor6        CON    0
  217. c_sensor7        CON    0
  218. c_batt_volt        CON    0
  219.  
  220. c_rc_swA        CON    1
  221. c_rc_swB        CON    1
  222.  
  223. c_delta_t        CON    0
  224. c_PB_mode        CON    1
  225. c_packet_num    CON    0
  226. c_res01        CON    0
  227.  
  228.  
  229. '---------- Initialization Constant VOLTAGE - USER DEFINED -------------------
  230. '  This is the 'Low Battery' detect voltage.  The 'Low Battery' LED will
  231. '  blink when the voltage drops below this value.
  232. '  Basically set VOLTAGE = INT ((DESIRED FLASH VOLTAGE + 0.4) * 16.3)
  233. '  Example, for a 10 Volt trigger, set Voltage eq 170.
  234.  
  235. dataInitVolt    CON 153    '9.0 Volts
  236.  
  237.  
  238.  
  239.  
  240. '========== DEFINE CONSTANTS (DO NOT CHANGE) =================================
  241. '=============================================================================
  242. ' Baud rate for communications with User CPU
  243. OUTBAUD    CON    20    ' (62500, 8N1, Noninverted)
  244. INBAUD    CON    20    ' (62500, 8N1, Noninverted)
  245.  
  246. USERCPU    CON 4
  247. FPIN        CON 1
  248. COMA        CON 1
  249. COMB        CON 2
  250. COMC        CON 3
  251.  
  252.  
  253.  
  254.  
  255. '========== MAIN PROGRAM =====================================================
  256. '=============================================================================
  257.  
  258. '---------- Input & Output Declarations --------------------------------------
  259.  
  260. Output    COMB
  261. Input        COMA
  262. Input        COMC
  263.  
  264. Output    7    'define Basic Run LED on RC => out7
  265.  
  266. Output      8    'define Robot Feedback LED => out8    => PWM1 Green
  267. Output      9    'define Robot Feedback LED => out9    => PWM1 Red
  268. Output      10    'define Robot Feedback LED => out10    => PWM2 Green
  269. Output      11    'define Robot Feedback LED => out11 => PWM2 Red
  270. Output      12    'define Robot Feedback LED => out12 => Relay1 Red
  271. Output      13    'define Robot Feedback LED => out13 => Relay1 Green
  272. Output      14    'define Robot Feedback LED => out14 => Relay2 Red
  273. Output      15    'define Robot Feedback LED => out15 => Relay2 Green
  274.  
  275.  
  276. '---------- Initialize Inputs & Outputs --------------------------------------
  277.  
  278. Out7  = 1        'Basic Run LED on RC
  279. Out8  = 0        'PWM1 LED - Green
  280. Out9  = 0        'PWM1 LED - Red
  281. Out10 = 0        'PWM2 LED - Green
  282. Out11 = 0        'PWM2 LED - Red
  283. Out12 = 0        'Relay1 LED - Red
  284. Out13 = 0        'Relay1 LED - Green
  285. Out14 = 0        'Relay2 LED - Red
  286. Out15 = 0        'Relay2 LED - Green
  287.  
  288. p1_x = 127        'Port 1, X-axis on Joystick
  289. p2_x = 127        'Port 2, X-axis on Joystick
  290. p3_x = 127        'Port 3, X-axis on Joystick
  291. p4_x = 127        'Port 4, X-axis on Joystick
  292.  
  293. p1_y = 127        'Port 1, Y-axis on Joystick
  294. p2_y = 127        'Port 2, Y-axis on Joystick
  295. p3_y = 127        'Port 3, Y-axis on Joystick
  296. p4_y = 127        'Port 4, Y-axis on Joystick
  297.  
  298. p1_wheel = 127    'Port 1, Wheel on Joystick
  299. p2_wheel = 127    'Port 2, Wheel on Joystick
  300. p3_wheel = 127    'Port 3, Wheel on Joystick
  301. p4_wheel = 127    'Port 4, Wheel on Joystick
  302.  
  303. 'p1_aux = 127    'Port 1, Aux Analog
  304. 'p2_aux = 127    'Port 2, Aux Analog
  305. 'p3_aux = 127    'Port 3, Aux Analog
  306. 'p4_aux = 127    'Port 4, Aux Analog
  307.  
  308.  
  309.  
  310.  
  311. '========== PBASIC - MASTER uP INITIALIZATION ROUTINE ========================
  312. '=============================================================================
  313. '  DO NOT CHANGE THIS!  DO NOT MOVE THIS!
  314. '  The init routine sends 5 bytes to the Master uP, defining which data bytes to receive.
  315. '  1)  Collect init.
  316. '  2)  Lower the COMA line, which is the clk line for the shift out command.
  317. '  3)  Lower COMB line to tell pic that we are ready to send init data.
  318. '  4)  Wait for pic to lower the COMC line, signaling pic is ready for data.
  319. '  5)  Now send out init dat to pic, all 5 bytes.
  320. '  6)  Now set direction and levels for the COMA and COMB pins.
  321.  
  322. tempA        CON    c_p3_x <<1 + c_p4_x <<1 + c_p1_x <<1 + c_p2_x <<1 + c_rc_swB
  323. dataInitA    CON    tempA <<1 + c_rc_swA <<1 + c_oi_swB <<1 + c_oi_swA
  324. tempB        CON    c_sensor4 <<1 + c_sensor3 <<1 + c_p1_y <<1 + c_p2_y <<1 + c_sensor2
  325. dataInitB    CON    tempB <<1 + c_sensor1 <<1 + c_packet_num <<1 + c_PB_mode
  326. tempC        CON    c_batt_volt <<1 + c_sensor7 <<1 + c_p1_wheel <<1 + c_p2_wheel <<1 + c_sensor6
  327. dataInitC    CON    tempC <<1 + c_sensor5 <<1 + c_p3_y <<1 + c_p4_y
  328. tempD        CON    c_res01 <<1 + c_delta_t <<1 + c_p3_aux <<1 + c_p4_aux <<1 + c_p1_aux
  329. dataInitD    CON    tempD <<1 + c_p2_aux  <<1 + c_p3_wheel <<1 + c_p4_wheel
  330.  
  331. Output    COMA
  332. low        COMA
  333. low        COMB
  334. Wait_init:    if IN3 = 1 then Wait_init:
  335. Shiftout    COMB,COMA,1, [dataInitA,dataInitB,dataInitC,dataInitD,dataInitVolt]
  336. Input        COMA
  337. high        COMB
  338.  
  339.  
  340.  
  341.  
  342. '========== MAIN LOOP ========================================================
  343. '=============================================================================
  344.  
  345. MainLoop:
  346.  
  347.  
  348. '---------- Serin Command - Get Data from Master uP --------------------------
  349. '  Construct the "serin" command using the following rules:
  350. '  1) There must be one variable for every input defined in the "Define Constants for Init" section.
  351. '  2) The order must match the order in the EXAMPLE SERIN COMMAND below.
  352. '  3) The total number of all variables may not exceed 26.
  353. '  4) Only use one "Serin" command.
  354. '  5) The Serin command must occupy one line.
  355. '
  356. '  If you see a BASIC INIT ERR on the Robot Controller after programming and pressing RESET, then
  357. '  there is a problem with the Serin command below.  Check the number of variables.  A BASIC INIT ERR
  358. '  will not occur if you have the variables in the wrong order, however your code will not work correctly.
  359. '
  360. '  EXAMPLE SERIN COMMAND
  361. '  This example exceed the 26 variable limit and is not on one line:
  362. '
  363. '  Serin COMA\COMB, INBAUD, [oi_swA,oi_swB,rc_swA,rc_swB,p2_x,p1_x,p4_x,p3_x,PB_mode,packet_num,sensor1,
  364. '                     sensor2,p2_y,p1_y,sensor3,sensor4,p4_y,p3_y,sensor5,sensor6,p2_wheel,p1_wheel,
  365. '                     sensor7,sensor8,p4_wheel,p3_wheel,p2_aux,p1_aux,p4_aux,p3_aux,delta_t,res01]
  366. '
  367.    Serin COMA\COMB, INBAUD, [oi_swA,oi_swB,rc_swA,rc_swB,p2_x,p1_x,p4_x,p3_x,PB_mode,p2_y,p1_y,p4_y,p3_y,p2_wheel,p1_wheel,p4_wheel,p3_wheel]
  368.  
  369.  
  370. '---------- Blink BASIC RUN LED ----------------------------------------------
  371. Toggle 7            'Basic Run LED on the RC is toggled ON/OFF every loop.
  372.  
  373.  
  374.  
  375.  
  376. '========== PERFORM OPERATIONS ===============================================
  377. '  Add your custom code here.
  378. '  Delete any of the following sections below (except for Output Data) as desired.
  379.  
  380.  
  381. '---------- Buttons to Relays ------------------------------------------------
  382.  
  383. '  The &  used below is the PBASIC symbol for AND
  384. '  The &~ used below is the PBASIC symbol for AND NOT
  385.  
  386. relay1_fwd = p1_sw_trig &~ rc_sw1     'Port 1 Trigger = Relay 1 Forward
  387.                         'Relay 1 wont go Forward if rc_sw1 is ON
  388.  
  389. relay1_rev = p1_sw_top &~ rc_sw2     'Port 1 Thumb = Relay 1 Reverse
  390.                         'Relay 1 wont go Reverse if rc_sw2 is ON
  391.  
  392. relay2_fwd = p2_sw_trig &~ rc_sw3     'Port 2 Trigger = Relay 2 Forward
  393.                         'Relay 2 wont go Forward if rc_sw3 is ON
  394.  
  395. relay2_rev = p2_sw_top &~ rc_sw4     'Port 2 Thumb = Relay 2 Reverse
  396.                         'Relay 2 wont go Reverse if rc_sw4 is ON
  397.  
  398. relay3_fwd = p3_sw_trig            'Port 3 Trigger = Relay 3 Forward
  399. relay3_rev = p3_sw_top             'Port 3 Thumb   = Relay 3 Reverse
  400. relay4_fwd = p4_sw_trig            'Port 4 Trigger = Relay 4 Forward
  401. relay4_rev = p4_sw_top             'Port 4 Thumb   = Relay 4 Reverse
  402.  
  403.  
  404. relay5_fwd = p1_sw_aux1            'Port 1 Aux1 = Relay 5 Forward
  405. relay5_rev = p1_sw_aux2            'Port 1 Aux2 = Relay 5 Forward
  406. relay6_fwd = p3_sw_aux1            'Port 3 Aux1 = Relay 6 Forward
  407. relay6_rev = p3_sw_aux2            'Port 3 Aux2 = Relay 6 Forward
  408. relay7_fwd = p4_sw_aux1            'Port 4 Aux1 = Relay 7 Forward
  409. relay7_rev = p4_sw_aux2            'Port 4 Aux2 = Relay 7 Reverse
  410. relay8_fwd = 1                'Relay 8 always Forward
  411. relay8_rev = 0                'Relay 8 always Forward
  412.  
  413.  
  414. '---------- Feedback LEDs for PWM1, PWM2 -------------------------------------
  415.  
  416. Out8  =   p1_y/216        'LED is ON when Victor883 full forward (default CAL)
  417. Out9  = ~(p1_y/56  max 1)    'LED is ON when Victor883 full reverse (default CAL)
  418. Out10 =   p2_y/216        'LED is ON when Victor883 full forward (default CAL)
  419. Out11 = ~(p2_y/56  max 1)    'LED is ON when Victor883 full reverse (default CAL)
  420.  
  421.  
  422. '---------- Feedback LEDs for Relay1, Relay2 ---------------------------------
  423.  
  424. Out13 = relay1_fwd        'LED is ON when Relay 1 is Forward
  425. Out12 = relay1_rev        'LED is ON when Relay 1 is Reverse
  426. Out15 = relay2_fwd        'LED is ON when Relay 2 is Forward
  427. Out14 = relay2_rev        'LED is ON when Relay 2 is Reverse
  428.  
  429.  
  430. '---------- PWM outputs Limited by Limit Switches  ---------------------------
  431.  
  432. if rc_sw5 = 0 then next1:
  433.     p3_y = p3_y MAX 127
  434. next1:
  435.  
  436. if rc_sw6 = 0 then next2:
  437.     p3_y = p3_y MIN 127
  438. next2:
  439.  
  440. if rc_sw7 = 0 then next3:
  441.     p4_y = p4_y MAX 127
  442. next3:
  443.  
  444. if rc_sw8 = 0 then next4:
  445.     p4_y = p4_y MIN 127
  446. next4:
  447.  
  448. if rc_sw9 = 0 then next5:
  449.     p1_wheel = p1_wheel MAX 127
  450. next5:
  451.  
  452. if rc_sw10 = 0 then next6:
  453.     p1_wheel = p1_wheel MIN 127
  454. next6:
  455.  
  456. if rc_sw11 = 0 then next7:
  457.     p2_wheel = p2_wheel MAX 127
  458. next7:
  459.  
  460. if rc_sw12 = 0 then next8:
  461.     p2_wheel = p2_wheel MIN 127
  462. next8:
  463.  
  464. if rc_sw13 = 0 then next9:
  465.     p3_wheel = p3_wheel MAX 127
  466. next9:
  467.  
  468. if rc_sw14 = 0 then next10:
  469.     p3_wheel = p3_wheel MIN 127
  470. next10:
  471.  
  472. if rc_sw15 = 0 then next11:
  473.     p4_wheel = p4_wheel MAX 127
  474. next11:
  475.  
  476. if rc_sw16 = 0 then next12:
  477.     p4_wheel = p4_wheel MIN 127
  478. next12:
  479.  
  480.  
  481.  
  482.  
  483. '========== OUTPUT DATA ======================================================
  484. '=============================================================================
  485. '  The Serout line sends data to the Output uP.  The Output uP passes this to each PWM 1-16
  486. '  and Relay 1-8.  The Output uP will not output data if there is no communication with the
  487. '  Operator Interface or if the Competition Mode is Disabled.  Do not delete any elements
  488. '  from the Serout array.  Set unused PWM outputs to 127.  Set unused relay outputs to 0.
  489. '
  490. '  Serout USERCPU, OUTBAUD, [255,255,(PWM1),relayA,(PWM2),relayB,(PWM3),(PWM4),(PWM5),(PWM6),(PWM7),(PWM8),(PWM9),(PWM10),(PWM11),(PWM12),(PWM13),(PWM14),(PWM15),(PWM16)]
  491.  
  492.    Serout USERCPU, OUTBAUD, [255,255,p1_y,relayA,p2_y,relayB,p3_y,p4_y,p1_x,p2_x,p3_x,p4_x,p1_wheel,p2_wheel,p3_wheel,p4_wheel,127,127,127,127]
  493.  
  494. Goto MainLoop:
  495.  
  496.  
  497. Stop