Thread: PBasic Probelm
View Single Post
  #8   Spotlight this post!  
Unread 08-04-2004, 13:55
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,855
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: PBasic Probelm

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
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 08-04-2004 at 13:58.