line sensing code

i have been looking at the default line sensor code and i cant seem to make heads or tails of it. has anyone written it from scratch? is it difficult to figure out??

also what do people think about it? is it like the vision tracking of previous years (not very helpful and a pain to get to work)?

my thought is that a much simpler autonomous would be easier. (ex. go forward, deploy arm, place tube on rack)

thanks in advance

-Wyatt C FIRST Team 1307

It’s quite easy. If you know how to wire it up to the digital side car then you can just open 3 digital inputs and get teh value of them in boolean format. After that you can use case structures or use “boolean to (0,1)” to tell the drive motors to go left, right, or stop.

National Instruments provides a very helpful Line Following Tutorial that explains its operation.

The default line sensor code essentially determines how to run the bot every some amount of seconds. That is either by goin forward full force, or turning and goin sideways
I’d suggest using a truth table, as the guide on NI suggest
Only problem is tat it makes the bot zigzag a lot over the line

Go to FRC Mastery. There is a breakdown of the code.