SunFounder picar-x
(continued from previous page)
if __name__ == "__main__":
try:
main()
except Exception as e:
print("error:%s"%e)
finally:
px.stop()
Vilib.camera_close()
4.11 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: Install
All the Modules.
cd ~
git clone https://github.com/sunfounder/sunfounder-controller.git
cd ~/sunfounder-controller
sudo python3 setup.py install
2. Run the code.
cd ~/sunfounder-controller/examples
sudo python3 picarx_control.py
3. Install SunFounder Controller from APP Store(iOS) or Google Play(Android).
4. Open and create a new controller.
Create a new controller by clicking on the + sign in the SunFounder Controller APP.
74 Chapter 4. Play with Python