EasyManua.ls Logo

Keyestudio Micro:bit Mini Smart Robot Car - Page 69

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...
51
www.keyestudio.com
2) Programming Thinking
1 At first, use a ultrasonic module to measure the distance between the micro:bit car and an obstacle
ahead.
2 When the measured distance is less than 10cm, the micro:bit car stops for 0.2 second, then turns left for
0.5 second and then goes forward. If the measured distance is greater than or equal to 10cm, the micro:bit car
will directly go forward.
3) Test Code