View Single Post
  #4   Spotlight this post!  
Unread 21-09-2005, 21:58
jdiwnab's Avatar
jdiwnab jdiwnab is offline
Really the Inventor Guy
AKA: Bryan Hartley
FRC #0617
Team Role: College Student
 
Join Date: Nov 2004
Rookie Year: 2002
Location: Highland Springs, VA
Posts: 260
jdiwnab is a jewel in the roughjdiwnab is a jewel in the roughjdiwnab is a jewel in the rough
Re: Array problems( i think....)

Quote:
Originally Posted by devicenull
Code:
while( i<90)
{
left_side[i]=p1_y;
right_side[i]=p2_y;
}
You forgot i++;, so its just an infinite loop.
True, but also, that loop would record the same values about 90 times (+/- 1). Better would be to have the record code in the main program and just do 2 if's (if button and i<90) so that it records what you do. Then in the replay code, use for(i=0, i<90, i++) {...} so that it will loop though it that number of times. This makes changing your code easier and easier to read.

<edit>
Quote:
Originally Posted by sciguy125
I'm also not sure if this is legal:
Code:
   pwm01,pwm02=127;
But, I guess if the compiler didn't complain, it's alright.
A better way would be "pwm01=pwm02=127;" becuase pwm02 then is 127, afterword, pwm01 would be set equal to pwm02, making pwm01 127. You could check the values with a debugger or have some visual output, but I don't think "pwm01,pwm02=127" does what you think it does, but it isn't the cause of the problem.
__________________
Proof that Macs will win the platform war: How did Scotty know how to use MacDraft in Star Trek IV?
// random()
I have 100 gmail invites. PM me if you want one.
If they want us to think outside of the box, why do they make us fit in a 38x28x60 inch box?
Beware of Geeks bearing GIFs
Help me test my server software

Last edited by jdiwnab : 21-09-2005 at 22:09.