Tutorial
Table Of Contents
- 1. Premise
- 2. Raspberry Pi System Installation and Developmen
- 3 Log In to The Raspberry Pi and Install The App
- 4 Assembly and Precautions
- 5 Controlling Robot via WEB App
- 6 Common Problems and Solutions(Q&A)
- 7 Set The Program to Start Automatically
- 8 Remote Operation of Raspberry Pi Via MobaXterm
- 9 How to Control WS2812 RGB LED
- 10 How to Control The Servo
- 11 How to Control DC Motor
- 12 Ultrasonic Module
- 13 Line Tracking
- 14 Make A Police Light or Breathing Light
- 15 Real-Time Video Transmission
- 16 Automatic Obstacle Avoidance
- 17 Why OpenCV Uses Multi-threading to Process Vide
- 18 OpenCV Learn to Use OpenCV
- 19 Using OpenCV to Realize Color Recognition and T
- 20 Machine Line Tracking Based on OpenCV
- 21 Create A WiFi Hotspot on The Raspberry Pi
- 22 Install GUI Dependent Item under Window
- 23 How to Use GUI
- 24 Control The WS2812 LED via GUI
- 25 Real-time Video Transmission Based on OpenCV
- 26 Use OpenCV to Process Video Frames on The PC
- 27 Enable UART
- 28 Control Your AWR with An Android Device
- Conclusion
78
'''
Call this function to turn on the police light mode
'''
self.lightMode = 'police'
self.resume()
def policeProcessing(self):
'''
The specific realization of the police light mode
'''
while self.lightMode == 'police':
'''
Blue flashes 3 times
'''
for i in range(0,3):
self.setSomeColor(0,0,255,[0,1,2,3,4,5,6,7,8,9,10,11])
time.sleep(0.05)
self.setSomeColor(0,0,0,[0,1,2,3,4,5,6,7,8,9,10,11])
time.sleep(0.05)
if self.lightMode != 'police':
break
time.sleep(0.1)
'''
Red flashes 3 times
'''
for i in range(0,3):
self.setSomeColor(255,0,0,[0,1,2,3,4,5,6,7,8,9,10,11])
time.sleep(0.05)
self.setSomeColor(0,0,0,[0,1,2,3,4,5,6,7,8,9,10,11])
time.sleep(0.05)
time.sleep(0.1)
def breath(self, R_input, G_input, B_input):
'''
Call this function to turn on the breathing light mode, you need to enter three
parameters, namely the brightness of the RGB three color channels, as the color when the
brightness of the breathing lamp is maximum
'''
self.lightMode = 'breath'
self.colorBreathR = R_input
self.colorBreathG = G_input