Our programmer last year wrote a code using easyC to select multiple autonoumous modes. What you need to do is start by making a Auto_Select Fuction Block and putting it under Initialize. In it start with a while loop using a GetOIDInput command (While GetOIDInput(1,1) == 0). Inside the loop add a GetOIDInput of that same digital input. Outside the loop start a timer followed by a while command of that same Digital Input as the statement (While GetOIDInput == 1).
Inside that loop add a Get Timer Command and have it changed to one of your variables (in the bottom of the window that opens up.) Add an If statement that reads when that timer reaches 200 milliseconds go into the If statement. Then add another if statement reading that if a digitial input does not equal 0 (If GetOIDInput ==! 0) add 1 to a variable that you create. Then the timer needs to be set back to 0.
You also need to define a Max Autonomous Select so that you do not go over the number of autonomous modes you have. Outside of the last If statement you created make another If statement the reads that if your variable was incrimented and your max value was not exceded that your auto select max. Add an else statement with a user code that will set your value to 0 if you max value is exceded.
I'm sorry that it seems so unorginized in this post but the code I have is at school which won't be open until monday. If you can wait that long PM me and I'll try to send it to you. (I Probably forgot some of the code too sorry about that). Hope I can help.
