SunFounder PiCar-X Kit
• Creates a separate thread to scan for keyboard input.
• Announces the start of the game using text-to-speech.
• Enters a continuous loop to:
– Check for detected colored objects and trigger actions when a valid object is detected.
– Handle keyboard input to control the robot and interact with the game.
• Handles quitting the game and exceptions like KeyboardInterrupt.
• Ensures that the camera is closed and the PiCar-X is stopped when exiting.
By understanding these key parts of the code, you can grasp the fundamental logic of how the PiCar-X robot responds to
keyboard input and detects and interacts with objects of a specific color using the camera and audio output capabilities.
Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook!
Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
Why Join?
• Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
• Learn & Share: Exchange tips and tutorials to enhance your skills.
• Exclusive Previews: Get early access to new product announcements and sneak peeks.
• Special Discounts: Enjoy exclusive discounts on our newest products.
• Festive Promotions and Giveaways: Take part in giveaways and holiday promotions.
Ready to explore and create with us? Click [] and join today!
4.15 13. Controlled by the APP
The SunFounder controller is used to control Raspberry Pi/Pico based robots.
The APP integrates Button, Switch, Joystick, D-pad, Slider and Throttle Slider widgets; Digital Display, Ultrasonic
Radar, Grayscale Detection and Speedometer input widgets.
There are 17 areas A-Q , where you can place different widgets to customize your own controller.
In addition, this application provides a live video streaming service.
Let’s customize a PiCar-X controller using this app.
How to do?
1. Install the sunfounder-controller module.
The robot-hat, vilib, and picar-x modules need to be installed first, for details see: 5. Install
All the Modules(Important).
cd ~
git clone https://github.com/sunfounder/sunfounder-controller.git
cd ~/sunfounder-controller
sudo python3 setup.py install
2. Run the code.
4.15. 13. Controlled by the APP 87