Answered: Problem with line followers😕

I’m having trouble with the line followers. I install Online code, install the 3-set line follower onto Squarebot, and check the analog reading. What I see is clearly not what I expect. Clearly, the reading is not what I expect. That happens on all 3 line followers. In case the line is bad, I used the mat that came with the line follower kit. Please help!!!:confused: :confused: :confused:

Try using our “Vex Sensor Test” (a quick go/no go test) located on our Downloads web page to verify if the sensor is working correctly.

I’m not sure if it’s bad. My online code test was quite some time ago.

The Terminal Window says it’s working. What’s the light-dark threshold? For example, what value must it be to change from light to dark, or vise versa? Or is it Schimitt-triggered?

Answered: See post Line Follower

Not that, the terminal window says it’s working, but what’s the threshold for “dark surface detected” and “light line detected” or vise verca?

**Again,there is no set threshold that will work for all environments. As the Sensor moves across a surface that is reflective, the infrared light will bounce back and give a low reading – ideally around 0. As the Sensor moves across a surface that is absorptive, the infrared light will not bounce back and give a high reading – ideally around 255. You will need to experiment with the values you are receiving to find the proper threshold. The readings you get will vary as your environment varies but in most cases you will see a noticeable difference.

In our go/no-go test we use the values of 0x030 and 0x200. **

The test code uses 0-1024. You said 0-255. What’s the confusion about?:confused: :confused:

The AD output is 10 bits which is an decimal integer value from 0 - 1023. Most applications do not use the 2 least significant values and therefore use numbers from 0-255.

Like when Line Follower exceeds 200, it switches to Dark Surface Detected, and when it lowers below 30, then it switches to Light Line Detected, right?

In our go/no-go test you should see values from 0-30 when the sensor is over a reflective surface and values of 200 or higher with the sensor over a non-reflective surface.

What about in-between figures? Schmitt means high turn-on figure, low turn-off figure.

**In our go / no-go test LED 2 (DIGITAL 14) will turn On when the Line Follower sees a white color - highly reflected or ambient infrared light detected corresponding to a value from 0-29 hex. The LED will remain On (for all values from 0-200 hex) until the sensor sees a dark color – a low or no infrared light detected corresponding to a value of 201 hex or higher. Likewise the LED will now remain Off until a value of 29 – 0 hex is reported.

The AD will read values from 0-3FF hex and we arbitrarily chose the values of 30 and 200 hex as our trigger points.**

I’m not done yet! I need parts of the test code to start my code on (the line follower parts).

Our Test Code is posted on the Support page. Although we have posted the Test Code we do not support it or your efforts in writing code.

…Aghh! I missed the point again! My robot needs a constant push, and now it is missing on the track!