SunFounder picar-x
5.16 Bullfight
Turn PiCar-X into an angry bull! Prepare a red cloth, such as a handkerchief, and become a Bullfighter. When the
PiCar-X chases after the red cloth, be careful not to get hit!
Note: This project is more advanced than the preceding projects. The PiCar-X will need to use the color detection
function to keep the camera facing towards the red cloth, then the body orientation will need to automatically adjust
in response to the direction that the camera is facing.
TIPS
Begin with adding the color detection [red] block to the Start widget to make the PiCar-X look for a red-colored
object. In the forever loop, add the [width] of detected color block to transform the input into an “object detection”
grid.
122 Chapter 5. Play with Ezblock