80
def
run(self):
'''
Functions for multi-threaded tasks
'''
while
1:
self.__flag.wait()
self.lightChange()
pass
if
__name__ == '__main__':
RL=RobotLight()
RL.start()
'''
Start breathing light mode and stop after 15 seconds
'''
RL.breath(70,70,255)
time.sleep(15)
RL.pause()
'''
Pause for 2 seconds
'''
time.sleep(2)
'''
Start the police light mode and stop after 15 seconds
'''
RL.police()
time.sleep(15)
RL.pause()
14.3 Warning Lights or Breathing Lights in Other Projects
● When your project needs to use LED lights for warning lights or breathing lights, you don't need to
rewrite the above code, just copy robotLight.py in the robot program server folder to the same In the folder,
then use the following code to use the warning light or breathing light:
import
robotLight
# Instantiate the object that controls the LED light
# Start thread
Need help?
Do you have a question about the AWR Adeept Wheeled Robot and is the answer not in the manual?