your variable declaration is executed every loop, meaning it will be initialized to 0 every loop. declare it as a static unsigned, and your counter will work.
I’d referain from making it a char. A char will overflow after 256 cycles. Running around 26.2hz, the main loop will make 256 cycles in around 9.8 seconds. After that, it will drop to zero and start rising again. I’d suggest you make it
Autonomous only lasts 15 seconds. And teleop is 2 minutes. With about only 39 iterations per second, an unsigned int is more than enough to hold the tick counter.
Also, I believe this variable would overflow in about 6.7 seconds. I suggest you blow the extra byte of memory and go for an unsigned integer just to cover everything, as this won’t overflow until after a whole 28 minutes at the 26.2ms rate.
I suggest a switch statement to run your time based autonomous.
If you are going to Cleveland, i’d be happy to give you some ‘pointers’. :]