View Single Post
  #5   Spotlight this post!  
Unread 11-02-2003, 09:41
seanwitte seanwitte is offline
Registered User
None #0116
Team Role: Engineer
 
Join Date: Nov 2002
Location: Herndon, VA
Posts: 378
seanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant future
Send a message via AIM to seanwitte
bitwise AND operator

Quote:
Code:
If 117 < p1_y & p1_y < 137 THEN stop_p1_y
If 117 < p3_y & p1_y < 137 THEN stop_p3_y
goto end_zero
Ampersand (&) is the bitwise logical AND operator. You'd have to use the word AND instead.

Code:
IF (117 < p1_y) AND (p1_y < 137) THEN p1_y = 127
IF (117 < p3_y) AND (p3_y < 137) THEN p3_y = 127

or, if you're using a symmetric deadband:

cDeadband CON 10

IF ABS(p1_y - 127) < cDeadband THEN p1_y = 127
IF ABS(p3_y - 127) < cDeadband THEN p3_y = 127
<edited>
Sorry, figured most teams would be using the new compiler. We haven't had any problems and it really is a lot more productive than the old version. (knocking on wood heard in background)
</edited>

Last edited by seanwitte : 11-02-2003 at 12:14.