GREEN = (0, 255, 0)
TEAL = (0, 255, 120)
CYAN = (0, 255, 255)
BLUE = (0, 0, 255)
PURPLE = (180, 0, 255)
MAGENTA = (255, 0, 20)
WHITE = (255, 255, 255)
while True:
# Change this number to change how long it stays on each solid color.
color_fill(RED, 0.5)
color_fill(YELLOW, 0.5)
color_fill(ORANGE, 0.5)
color_fill(GREEN, 0.5)
color_fill(TEAL, 0.5)
color_fill(CYAN, 0.5)
color_fill(BLUE, 0.5)
color_fill(PURPLE, 0.5)
color_fill(MAGENTA, 0.5)
color_fill(WHITE, 0.5)
# Increase or decrease this to speed up or slow down the animation.
slice_alternating(0.1)
color_fill(WHITE, 0.5)
# Increase or decrease this to speed up or slow down the animation.
slice_rainbow(0.1)
time.sleep(0.5)
# Increase this number to slow down the rainbow animation.
rainbow_cycle(0)
We've chosen pins A1 and A2, but these are not SPI pins on all boards. DotStars respond faster when using
hardware SPI!
Create the LED
The first thing we'll do is create the LED object. The DotStar object has three required arguments and two optional
arguments. You are required to set the pin you're using for data, set the pin you'll be using for clock, and provide the
number of pixels you intend to use. You can optionally set
DotStars can be driven by any two pins. We've chosen A1 for clock and A2 for data. To set the pins, include the pin
names at the beginning of the object creation, in this case
To provide the number of pixels, assign the variable
example, we're using a strip of
We've chosen to set
brightness=0.1
By default,
auto_write=True
the default, if you use that setting, you don't need to include it in your LED object at all. We've chosen to
set
. If you set
auto_write=False
© Adafruit Industries
num_pixels
.
72
, or 10%.
, meaning any changes you make to your pixels will be sent automatically. Since
, you must include
auto_write=False
https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51
and
brightness
auto_write
and
board.A1
board.A2
to the number of pixels you'd like to use. In this
pixels.show()
.
.
each time you'd like to send data
Page 142 of 183
is
True
Need help?
Do you have a question about the Feather M4 Express and is the answer not in the manual?