|
Re: !HELP! IM STUCK IN A SUBROUTINE!!! !HELP!
Cameron,
I can not identify exactly where your problem is. Here are some ideas.
I would add a check after incrementing time and set time = 0 if time < 0.
I would look at where time is declared and insure that it is static. Beware of dynamic initializations...
As a matter of style, I would use the form ((A > B) && (A < C)) rather than (A > B && A < C) when working with students. It adds nothing to the speed of the code and eliminates the memorization of operator precedence.
Lastly, I would add a printf to determine what is going on. I strongly suspect the initialization of time is either implicit or the variable is getting stepped on between loops.
Regards,
Mike
__________________
Mike Betts
Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013
As easy as 355/113...
|