11.2.1 Running the warning light program
1. Turn on PiCarPro, the boot time is about 1 minute.
2. After PiCarPro is turned on, enter the IP address of your Raspberry Pi with the
Google browser of your mobile phone or computer, and access port 5000, for example:
192.168.3.44:5000 (see lesson 2 for detailed steps). The web controller will then be
displayed on the browser.
3. Click "POLICE LIGHT", PiCarPro starts flashing lights of different colors.
4. When you want to stop the warning light function, click "POLICE LIGHT" again.
11.2.2 Main code program
For the complete code, please refer to the file robotLight.py.
Warning light mode method function
1.
policeProcessing(self):
def
2.
i
for
3.
self.colorWipe(Color(0,0,255))
4.
time.sleep(0.05)
5.
self.colorWipe(Color(0,0,0))
6.
time.sleep(0.05)
range(0,3):
in
160
Need help?
Do you have a question about the PiCar-Pro and is the answer not in the manual?