|
Re: Code error with while loops??
Along with JakeM's great explanation, I'd like to point you to my white paper "A programming template for Autonomous Mode": Chief Delphi => CD Media => Papers => Search => keyword => Autonomous mode.
If you hardcode constants like 900 in your example, in order to tune the routine you'll have to change the constant within the code (and maybe that 900 in several places), and the work will cascade as you do more counts in subsequent steps.
A state machine is a great way to implement steps within Auton. mode and I hope the paper helps. There's a lot of good information in the White Papers section, and when things calm down you can spend some time looking at what's there, and see if they will help with the things you're learning.
GaryK
__________________
Silicon Valley Regional 2005, 2006 972
Silicon Valley Regional 2007 668 Xerox Creativity Award
Championship Event 2007 668
Portland Regional 2008 668
Silicon Valley Regional 2008 668, 972
Beta Test Team 2008 668 (with 100 & 254)
Silicon Valley Regional 2009 668 Regional Chairman's Award; 2643
Sacramento Regional 2009 668 Winning Alliance (thanks, 1717 & 2473!), 2010 Winning Alliance 3256
CalGames 2006, 2007, 2008, 2009, 2010, 2011 Field Tech
NorCal FTC Regional 2008, 2009 Inspector
Championship Event 2009
San Diego, Silicon Valley Regionals; Champ. Event 2010 668, 2643, 3256
Silicon Valley, Madera Regional 2012 2643
WRRF Programming Instructor 2006-2016
Regional Woodie Flowers Award 2014 2643 Utah Regional
|