EasyManua.ls Logo

Keyestudio Micro:bit Mini Smart Robot Car - Page 57

Keyestudio Micro:bit Mini Smart Robot Car
132 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
39
www.keyestudio.com
2) Programming Thinking
1 At first judge the middle tracking sensor. If it detects a black line, no matter detect a black line on either
side, the micro:bit car always goes forward.
2 If the middle tracking sensor does not detect a black line, then judge the sensor on both sides.
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

Related product manuals