ADEEPT AWR Wheeled Robot Manual page 85

4wd smart robot kit compatible with raspberry pi 4 3 model b+ b, opencv target tracking
Table of Contents

Advertisement

76
'''
Use the Threading module to create threads, inherit directly from threading.Thread, and
then override the __init__ method and the run method
'''
class
RobotLight(threading.Thread):
def
__init__(self, *args, **kwargs):
'''
Here initialize some settings about LED lights
'''
self.LED_COUNT
self.LED_PIN
self.LED_FREQ_HZ =
self.LED_DMA
self.LED_BRIGHTNESS =
self.LED_INVERT
level shift)
self.LED_CHANNEL =
'''
Set the brightness of the three RGB color channels, no need to change here, these
values will be automatically set after the subsequent call of the breathing light function
'''
self.colorBreathR =
self.colorBreathG =
self.colorBreathB =
self.breathSteps =
'''
The mode variable, 'none' will make the thread block and hang, the light will not
change;
'police' is a police light mode, red and blue flash alternately;
'breath' breathing light, you can set the specified color.
'''
self.lightMode = 'none'
# Create NeoPixel object with appropriate configuration.
self.strip = Adafruit_NeoPixel(self.LED_COUNT, self.LED_PIN, self.LED_FREQ_HZ,
# Intialize the library (must be called once before other functions).
self.strip.begin()
=
16
# Number of LED pixels.
=
12
# GPIO pin connected to the pixels (18 uses PWM!).
800000
# LED signal frequency in hertz (usually 800khz)
=
10
# DMA channel to use for generating signal (try 10)
255
# Set to 0 for darkest and 255 for brightest
=
False
# True to invert the signal (when using NPN transistor
0
# set to '1' for GPIOs 13, 19, 41, 45 or 53
0
0
0
10
#'none' 'police' 'breath'
self.LED_DMA, self.LED_INVERT, self.LED_BRIGHTNESS,
self.LED_CHANNEL)

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the AWR Adeept Wheeled Robot and is the answer not in the manual?

This manual is also suitable for:

Picar-b

Table of Contents

Save PDF