17. self.LED_BRIGHTNESS,
18. self.LED_CHANNEL
19. )
20. self.strip.begin()
21. def colorWipe(self,color): # This function is used to change the color of the LED lamp
22. for i in range(self.strip.numPixels()): #Only one LED lamp color can be set at a time, so a cycle is
required
23. self.strip.setPixelColor(i, color)
24. self.strip.show() #After calling the show method, the color will really change
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