View Single Post
  #9   Spotlight this post!  
Unread 02-11-2016, 03:44 AM
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 667
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: Autonomous in iterative robot

Quote:
Originally Posted by Tparbotmail View Post
I did do quite a bit of coding tonight using these techniques and I am seeing case 2 logic being executed when case1 is the state iterative autonomous. If the encoder values I am checking for are true in both case1 and case2 then the sequence becomes unstable. The only way I can think to protect case1 logic from case2 is to use Booleans
Case1:
If (encoder < 400 && case1-Boolean == true && case2-Boolean == false)

Then do some work

State++
Break;
Case2:
If (encoder < 400 && case1-Boolean == false && case2-Boolean == true)

Do some other work.

Is there a way in eclipse to step throu the code while it is executing on the rio?
Sorry, I am not sure I understand what you are describing. Are you saying while state is 1, the logic in state 2 is executed? That's impossible unless you have a code path that did not have a "break" and the code fell through to the next case.
__________________
Reply With Quote