Skip to content

Commit 1d469d1

Browse files
WIP
1 parent 1e20b41 commit 1d469d1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed
File renamed without changes.

examples/cpx_rotate.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Simple fancyled example for Circuit Playground Express
1+
# Simple FancyLED example for Circuit Playground Express
22

33
from adafruit_circuitplayground.express import cpx
4-
import fancyled
4+
import adafruit_fancyled as fancy
55

66
# A dynamic gradient palette is a compact representation of a color palette
77
# that lists only the key points (specific positions and colors), which are
@@ -17,19 +17,19 @@
1717
# Here's where we convert the dynamic gradient palette to a full normal
1818
# palette. First we need a list to hold the resulting palette...it can be
1919
# filled with nonsense but the list length needs to match the desired
20-
# palette length (in FastLED, after which fancyled is modeled, color
20+
# palette length (in FastLED, after which FancyLED is modeled, color
2121
# palettes always have 16, 32 or 256 entries...we can actually use whatever
2222
# length we want in CircuitPython, but for the sake of consistency, let's
2323
# make it a 16-element palette...
2424
palette = [0] * 16
25-
fancyled.loadDynamicGradientPalette(blackbody, palette)
25+
fancy.loadDynamicGradientPalette(blackbody, palette)
2626

2727
# The dynamic gradient step is optional...some projects will just specify
2828
# a whole color palette directly on their own, not expand it from bytes.
2929

3030
# This function fills the Circuit Playground Express NeoPixels from a
3131
# color palette plus an offset to allow us to 'spin' the colors. In
32-
# fancyled (a la FastLED), palette indices are multiples of 16 (e.g.
32+
# FancyLED (a la FastLED), palette indices are multiples of 16 (e.g.
3333
# first palette entry is index 0, second is index 16, third is 32, etc)
3434
# and indices between these values will interpolate color between the
3535
# two nearest palette entries.
@@ -38,10 +38,10 @@ def FillLEDsFromPaletteColors(palette, offset):
3838
# This looks up the color in the palette, scaling from
3939
# 'palette space' (16 colors * 16 interp position = 256)
4040
# to 'pixel space' (10 NeoPixels):
41-
c = fancyled.ColorFromPalette(palette,
41+
c = fancy.ColorFromPalette(palette,
4242
int(i * len(palette) * 16 / 10 + offset), 255, True)
4343
# Gamma correction gives more sensible-looking colors
44-
cpx.pixels[i] = fancyled.applyGamma_video(c)
44+
cpx.pixels[i] = fancy.applyGamma_video(c)
4545

4646
# This is an offset (0-255) into the color palette to get it to 'spin'
4747
adjust = 0

0 commit comments

Comments
 (0)