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
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
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
in
range(0,3):
in
range(0,3):
Need help?
Do you have a question about the AWR Adeept Wheeled Robot and is the answer not in the manual?