17.
self.LED_BRIGHTNESS,
18.
self.LED_CHANNEL
19.
)
20.
self.strip.begin()
21.
def
colorWipe(self,color):
22.
for
i
in
range(self.strip.numPixels()):
required
23.
self.strip.setPixelColor(i, color)
24.
self.strip.show()
Build LED control class.
1.
if
__name__ == '__main__':
2.
led = LED()
3.
led.colorWipe(0,0,255)
①The colorWipe() method must be used to pack the RGB value, and then pass it
to the function for color switching.
Lesson 6 Displaying Text on the OLED Screen
In this lesson, we will learn how to display text on the OLED screen.
6.1 Components used in this course
Components
Raspberry Pi
Robot HAT
4 pin wire
OLED screen
# This function is used to change the color of the LED lamp
#Only one LED lamp color can be set at a time, so a cycle is
#After calling the show method, the color will really change
Quantity
1
1
1
1
77
Picture
Need help?
Do you have a question about the PiCar-Pro and is the answer not in the manual?