Line Tracker Usage Help

Hey!
So, we are trying to use line trackers for our auton, and I was looking at the PROS API. However, it was not much of a help, and I was wondering if there are any good resources to learn how to use the trackers.

Thanks

It’s a bit unclear what you are asking for… how to get the value from the line sensor or how to use that value?

If you are having trouble setting up the line sensor in PROS you should read the api. The line sensor falls under the 3 wire ADI (TriPort) category in the docs. ADI stands for the analog digital interface of the brain. It gets its name because this is where you can connect either analog or digital 3 wire sensors. You first need to understand the difference between analog and digital sensors (taken from here)

  1. An on/off switch placed on the door frame. This is a digital input. It will allow you to detect when the door is closed and when it is open, but will not detect anything between these states
  2. A potentiometer attached to the door hinge. This is an analog input. It will allow you to detect the amount that the door is open or closed. For example, you could use it to tell if the door was 50% open, 12.3376…% open, or any other amount between completely closed (0% open) and completely open (100% open).

VEX Line Trackers operate by measuring the amount of light reflected to the sensor and determining the existence of lines from the difference in light reflected by the white tape and the dark tiles. The Line Trackers return a value between 0 and 4095, with 0 being the lightest reading and 4095 the darkest. It is recommended that Line Trackers be calibrated to account for changes in ambient light.
(see)

So we can conclude that they are an analog sensor. Since we only get values from the line sensor, it is an input to the brain. Therefore, we can narrow the ADI section of the docs to the pros::ADIAnalogIn section. You can read the related documentation here and view a short example here.

If you have this figured out, then maybe you are asking how to make the values of the line sensor useful?
This is a good introductory article. Here is a vf thread with some relevant discussion and robotC examples. This blog digs deeper into how the line sensor works and advanced uses of it.

You may see some people talking about using the line sensor to detect balls, colored surfaces etc. These will all work with a similar method to line detection, but just be careful that changes in the environment’s lighting can drastically affect the line sensor values. I would suggest investing in the new distance or color sensors for applications like this. They are more reliable for these kind of situations.

6 Likes