Keyestudio Micro:bit Mini Smart Robot Car Manual page 57

Table of Contents

Advertisement

www.keyestudio.com
2) Programming Thinking
At first judge the middle tracking sensor. If it detects a black line, no matter detect a black line on either
1
side, the micro:bit car always goes forward.
If the middle tracking sensor does not detect a black line, then judge the sensor on both sides.
2
If the left sensor detects a black line, but the right sensor doesn't, the micro:bit car will turn left;
If the right sensor detects a black line, but the left sensor doesn't, the micro:bit car will turn right;
If all three sensors do not detect a black line, the micro:bit car will stop.
3) Test Code
39

Advertisement

Table of Contents
loading

Table of Contents