MindStorms Line-following Maths

x-axis=sensor input .... y-axis = direction ouput to motor

Use the graph above to find the best values for m and c.

The horizontal axis (x) is the input from the line sensor. 0=black, 100=white.
The vertical axis (y) is the direction to the motor. -100=full left turn, 0=straight, +100=full right turn
Adjust c and m until the line fits what you need:
﻿- the x intercept should be the light input value you want your robot to start turning at. (typically 50-80)
﻿- the y intercept should be the maximum amount you want your robot to turn. (typically 50-100)