kopia lustrzana https://github.com/blaz-r/pico_python_ws2812b
Update ws2812b.py
rodzic
6fd21ff187
commit
dcde5515b3
12
ws2812b.py
12
ws2812b.py
|
@ -69,14 +69,16 @@ class ws2812b:
|
||||||
|
|
||||||
# rotate x pixels to te left
|
# rotate x pixels to te left
|
||||||
def rotate_left(self, num_of_pixels):
|
def rotate_left(self, num_of_pixels):
|
||||||
if num_of_pixels != None:
|
if num_of_pixels == None:
|
||||||
self.pixels = self.pixels[num_of_pixels:] + self.pixels[:num_of_pixels]
|
num_of_pixels = 1
|
||||||
|
self.pixels = self.pixels[num_of_pixels:] + self.pixels[:num_of_pixels]
|
||||||
|
|
||||||
# rotate x pixels to the right
|
# rotate x pixels to the right
|
||||||
def rotate_right(self, num_of_pixels):
|
def rotate_right(self, num_of_pixels):
|
||||||
if num_of_pixels != None:
|
if num_of_pixels == None:
|
||||||
num_of_pixels = -1 * num_of_pixels
|
num_of_pixels = 1
|
||||||
self.pixels = self.pixels[num_of_pixels:] + self.pixels[:num_of_pixels]
|
num_of_pixels = -1 * num_of_pixels
|
||||||
|
self.pixels = self.pixels[num_of_pixels:] + self.pixels[:num_of_pixels]
|
||||||
|
|
||||||
def show(self):
|
def show(self):
|
||||||
for i in range(self.num_leds):
|
for i in range(self.num_leds):
|
||||||
|
|
Ładowanie…
Reference in New Issue