Quote:
|
Originally Posted by Astronouth7303
FIRST is a label. Wouldn't you use goto, not gosub?
|
In PBasic the "basic" program structure would look like this:
Code:
MainLoop:
'---------- Serin Command - Get Data from Master uP -------------
Serin COMA\COMB, INBAUD, [oi_swA,oi_swB,rc_swA,rc_swB,p1_x,PB_mode,p2_y,p1_y]
. . .
gosub RESCALE_STICK
. . .
Serout USERCPU, OUTBAUD, [255,255,127,relayA,127,127,pwm2,pwm1,127,127,127,127,pwm9,127,127,127,127,127,127,127]
Goto MainLoop:
'-------- SUBROUTINES ----------------------------------------
RESCALE_STICK:
'Rescale the output of the joysticks
. . .
RETURN
Stop