Skip to content

Commit b9259da

Browse files
authored
Merge pull request #81 from FoamyGuy/use_rainbowio
use rainbowio for colorwheel
2 parents 2eb9fc0 + 4d82c83 commit b9259da

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

examples/seesaw_rotary_neopixel.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@
33

44
"""I2C rotary encoder NeoPixel color picker and brightness setting example."""
55
import board
6+
from rainbowio import colorwheel
67
from adafruit_seesaw import seesaw, neopixel, rotaryio, digitalio
78

8-
try:
9-
import _pixelbuf
10-
except ImportError:
11-
import adafruit_pypixelbuf as _pixelbuf
129

1310
# For use with the STEMMA connector on QT Py RP2040
1411
# import busio
@@ -42,7 +39,7 @@
4239
else:
4340
color -= 1 # Advance backward through the colorwheel.
4441
color = (color + 256) % 256 # wrap around to 0-256
45-
pixel.fill(_pixelbuf.colorwheel(color))
42+
pixel.fill(colorwheel(color))
4643

4744
else: # If the button is pressed...
4845
# ...change the brightness.

0 commit comments

Comments
 (0)