|
With a few more conditions, yeah, that is how my autonomous code looks like. Of course we haven't considered what the wire mesh ramp will do.
As for that autonomous code. What you have seems to be the simple answer. Why say "do this for 2 seconds." Why not have it do something for X amount of ticks which through, testing, we know is about 2 seconds. I was worried about what other teams were doing with timers. I really don't think its neccessary to have your robot do something for exactly X seconds.
About the memory. Knowing what happened in the past few seconds would be neccessary if you wanted to try to fix an problem like being up the wire mesh ramp with sensors going haywire. The program needs to have significant "messed up" data before deciding its on the ramp and ignoring the sensors. Or it would be neccessary for those who want to examine the amount of current drawn for the motors. One input value wouldn't be representative of the bigger condition.
About the line of code:
I would private message you the response back, but I don't know how to use it. For any pointer data types(except void), the [] operator is always available to you. You don't even have to overload it. I'm sure thats true of both C and C++.
__________________
Ogun's Laughter is No Joke!!!
|