kopia lustrzana https://github.com/blaz-r/pi_pico_neopixel
Fixed function so the hue stays in 2^16 range
rodzic
05be57279b
commit
14870677d4
|
@ -123,6 +123,9 @@ class Neopixel:
|
||||||
# https://github.com/adafruit/Adafruit_NeoPixel so all the credits for that
|
# https://github.com/adafruit/Adafruit_NeoPixel so all the credits for that
|
||||||
# go directly to them (license: https://github.com/adafruit/Adafruit_NeoPixel/blob/master/COPYING)
|
# go directly to them (license: https://github.com/adafruit/Adafruit_NeoPixel/blob/master/COPYING)
|
||||||
def colorHSV(self, hue, sat, val):
|
def colorHSV(self, hue, sat, val):
|
||||||
|
if hue >= 65536:
|
||||||
|
hue %= 65536
|
||||||
|
|
||||||
hue = (hue * 1530 + 32768) // 65536
|
hue = (hue * 1530 + 32768) // 65536
|
||||||
if hue < 510:
|
if hue < 510:
|
||||||
b = 0
|
b = 0
|
||||||
|
|
Ładowanie…
Reference in New Issue