View Single Post
  #11   Spotlight this post!  
Unread 24-06-2002, 00:53
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
Re: PBASIC HELP, ASAP!!

Posted by Joe Ross at 2/14/2001 6:18 PM EST


Engineer on team #330, Beach Bot, from Hope Chapel Academy and NASA/JPL , J&F Machine, and Raytheon.


In Reply to: PBASIC HELP, ASAP!!
Posted by bill whitley on 2/14/2001 5:39 PM EST:



: Can anyone double check this code? Tell me if it will work.

: if p3_wheel > 240 then relay5_fwd = 1

: if p3_wheel 240 then JUMP2
: relay5_fwd = 0
: relay5_rev = 0

: JUMP2:

: if p4_wheel > 240 then relay6_fwd = 1

: if p4_wheel 240 then JUMP3
: relay6_fwd = 0
: relay6_rev = 0

: JUMP3:

: I am concerned about ending the IF THEN statements.

The code should tokenize, but it may not do what you want ;-)

The if-then statements look ok, except that I'm not sure that you want to use an "and". The way the code is written now, all the relays will always be set to 0 because p3_wheel and p4_wheel can never be less than 15 AND more than 240. It looks like you want an OR which says if p3_wheel is either less than 15 OR greater than 240, goto the code for p4_wheel.

The symbol for OR in PBASIC is "|". If you replace the "&" with "|" you should be OK.


__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.