hey ladies and gentleman, I have a question about using a line tracker code?
So for our Robotics class, we are having a line drill challenge. Basically we go to the three point line, back, half-court line, back, far three point line, back, full court and back. Now the question is how can i have the line tracker on at specific points and not?
The line tracker will always be on whenever it’s plugged into the cortex so you’ll have to accommodate for the variables it will spit out.
Option 1: Record the distances (encoder counts) to different lines. Watch the encoder. Once you’re past certain counts, then start checking the line tracker. Leave yourself some room for error by starting to check a little early.
Option 2: Check the line tracker repeatedly. But keep track of which line you want. Skip lines until you get there. For example, if you want the third line, you might start with lineFound=0, and bump that up to lineFound=1 when you hit the first, lineFound=2 when you find the second, and then when lineFound bumps up to 3 you turn around. The nice thing about this is that it works very well in a for loop.
I’m sure you could go with plenty of other options. Those were just two I could write quickly.