View Single Post
  #2   Spotlight this post!  
Unread 02-11-2006, 17:27
divergentdave divergentdave is offline
Registered User
FRC #1816 (Green Machine)
 
Join Date: Jun 2006
Rookie Year: 2007
Location: MN
Posts: 35
divergentdave is a jewel in the roughdivergentdave is a jewel in the roughdivergentdave is a jewel in the rough
Send a message via AIM to divergentdave
Re: Need help with ramping in VEX EasyC

Try this
Code:
 for ( step1 = 0, step2 = 255 ; step1 < 127 && step2 > 127 ; step1 += 5, step2 += 5 )
I may have my languages confused, but that should work. Earlier you were trying to use a short circuit logic operator, which doesn't always evaluate the right hand side. For example, assigning 0 to step1 also returns a 0, and the 0 gets passed to the && operator, which then interprets 0 as false, and thus doesn't even execute step2 = 255. Separating your two statements with commas explicitly tells the compiler to run both.
__________________
Team 1816 - The Green Machine