MakeCode JoyCar Line tracking
The Linefinder sensors send out an infrared signal which is reflected when it hits a light background and thus returns a high signal (1). If the infrared signal hits a dark background, such as a painted black line, the signal is not reflected and the sensor returns a low signal (0).
This allows the JoyCar with its three linefinder sensors on the bottom side to follow a painted black line on its own. We have prepared a small demo program for this purpose.
With button A on your micro:bit you can switch the line tracking mode on and off.
For a better overview of which action has to be performed at which sensor values, we have created a truth table here.
|Linefinder Left||Linefinder Middle||Linefinder Right||Action|