main
Blaž Rolih 2021-04-15 16:56:23 +02:00 zatwierdzone przez GitHub
rodzic 0aa24fb142
commit 06c3e63cf3
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 8 dodań i 1 usunięć

Wyświetl plik

@ -7,6 +7,8 @@ https://github.com/benevpi/pico_python_ws2812b/blob/main/pico_ws2812b.jpg)
You'll first need to save the ws2812b.py file to your device (for example, open it in Thonny and go file > save as and select MicroPython device. Give it the same name). Once it's there, you can import it into your code.
Mind that library works with GRB order of bits. If you have RGBW or want other color/bit orders (RGB, BRG, GRBW.. ) check out my upgraded version https://github.com/blaz-r/pi_pico_neopixel .
You create an object with the parameters number of LEDs, state machine ID and GPIO number in that order. so, to create a strip of 10 leds on state machine 0 and GPIO 0, you use:
```
@ -30,4 +32,9 @@ pixels.set_pixel_line(5, 7, rgb1)
pixels.set_pixel_line_gradient(0, 13, rgb1, rgb2)
```
Library is forked from https://github.com/benevpi/pico_python_ws2812b
For new settings to take effect you write:
```
pixels.show()
```
Library is forked from https://github.com/benevpi/pico_python_ws2812b