View Single Post
  #5   Spotlight this post!  
Unread 16-02-2003, 22:59
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
Quote:
Originally posted by Coach C

if ((pX_sw_trig ~= LastState) & (pX_sw_trig = 1)) then
relayX_fwd = OpenClose
OpenClose = OpenClose - 1
endif
LastState = pX_sw_trig
The PBASIC operator for not equal is <>. Also, use the keyword AND instead of &. Finally, can get rid of the variable OpenClose and just use relayX_fwd=1-relayX_fwd if you are running low on variable space. Either way, make sure to set relayX_rev=1-relayX_fwd.
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php