コード例 #1
0
pixel_num = 32

pixels = neopixel.NeoPixel(pixel_pin,
                           pixel_num,
                           brightness=0.5,
                           auto_write=False)

blink = Blink(pixels, speed=0.5, color=JADE)
colorcycle = ColorCycle(pixels, speed=0.4, colors=[MAGENTA, ORANGE])
comet = Comet(pixels, speed=0.01, color=PURPLE, tail_length=10, bounce=True)
chase = Chase(pixels, speed=0.1, size=3, spacing=6, color=WHITE)
pulse = Pulse(pixels, speed=0.1, period=3, color=AMBER)
sparkle = Sparkle(pixels, speed=0.1, color=PURPLE, num_sparkles=10)
solid = Solid(pixels, color=JADE)
rainbow = Rainbow(pixels, speed=0.1, period=2)
sparkle_pulse = SparklePulse(pixels, speed=0.1, period=3, color=JADE)
rainbow_comet = RainbowComet(pixels, speed=0.1, tail_length=7, bounce=True)
rainbow_chase = RainbowChase(pixels, speed=0.1, size=3, spacing=2, step=8)
rainbow_sparkle = RainbowSparkle(pixels, speed=0.1, num_sparkles=15)
custom_color_chase = CustomColorChase(pixels,
                                      speed=0.1,
                                      size=2,
                                      spacing=3,
                                      colors=[ORANGE, WHITE, JADE])

animations = AnimationSequence(
    comet,
    blink,
    rainbow_sparkle,
    chase,
    pulse,
コード例 #2
0
#    They can be a single line or a group of animations - the groups will play
#    at the same time, overlaid on top of each other.

readingLight = Solid(pixels, color=0xFF7D13)  #warm white color HEX code
brightWhite = Solid(pixels, color=(150, 150, 150))
rainbow = Rainbow(pixels, speed=0.1, period=10, step=0.5)
rainbowfade = RainbowFade(pixels, speed=0.4, name="rainbowfade")
powerup = RainbowComet(pixels, speed=0, tail_length=50, bounce=False)
off = Solid(pixels, color=BLACK)

#startup animation will play just once
startup = AnimateOnce(powerup)

#starrynight and fire are animation groups with layered effects.
starrynight = AnimationGroup(
    SparklePulse(pixels, speed=0.01, color=(0, 0, 150), period=1),
    Comet(pixels, speed=0, tail_length=8, color=(150, 150, 150), bounce=False),
)

fire = AnimationGroup(
    Comet(pixels, speed=0, tail_length=1, color=BLACK),
    Sparkle(pixels, speed=0.05, num_sparkles=10, color=AMBER),
    Sparkle(pixels, speed=0.05, num_sparkles=10, color=RED),
    Sparkle(pixels, speed=0.05, num_sparkles=20, color=ORANGE),
    Sparkle(pixels, speed=0.05, num_sparkles=5, color=0xFF7D13),
    Sparkle(pixels, speed=0.05, num_sparkles=10, color=BLACK),
)

# Here is the animation playlist where you set the order of modes

animations = AnimationSequence(
コード例 #3
0
group.append(rect3)
group.append(rect4)

display.show(group)

pixels = rect1

blink = Blink(pixels, speed=0.5, color=0x00FF00)
colorcycle = ColorCycle(pixels, speed=0.4, colors=[MAGENTA, YELLOW])
comet = Comet(pixels, speed=0.01, color=PURPLE, tail_length=10, bounce=True)
chase = Chase(pixels, speed=0.1, size=3, spacing=6, color=WHITE)
#pulse = Pulse(pixels, speed=0.1, period=3, color=0x00FF00)
sparkle = Sparkle(pixels, speed=0.1, color=PURPLE, num_sparkles=10)
solid = Solid(pixels, color=0x00FF00)
#rainbow = Rainbow(pixels, speed=0.1, period=2)
sparkle_pulse = SparklePulse(pixels, speed=0.1, period=3, color=0x00FF00)
rainbow_comet = RainbowComet(pixels, speed=0.1, tail_length=7, bounce=True)
rainbow_chase = RainbowChase(pixels, speed=0.1, size=3, spacing=2, step=8)
#rainbow_sparkle = RainbowSparkle(pixels, speed=0.1, num_sparkles=15)
custom_color_chase = CustomColorChase(pixels,
                                      speed=0.1,
                                      size=2,
                                      spacing=3,
                                      colors=[ORANGE, WHITE, JADE])

blink2 = Blink(rect2, speed=0.5, color=0x0000FF)
colorcycle2 = ColorCycle(rect2, speed=0.4, colors=[MAGENTA, BLUE])
comet2 = Comet(rect2, speed=0.01, color=PURPLE, tail_length=10, bounce=True)
chase2 = Chase(rect2, speed=0.1, size=3, spacing=6, color=WHITE)
#pulse2 = Pulse(rect2, speed=0.1, period=3, color=0x0000FF)
sparkle2 = Sparkle(rect2, speed=0.1, color=PURPLE, num_sparkles=10)
コード例 #4
0
rect1 = anisha.Arect(16, 1, 30, 30, outline=0x004000, stroke=2, colors=128)

group = displayio.Group()
group.append(rect1)

display.show(group)

blink = Blink(rect1, speed=0.5, color=JADE)
colorcycle = ColorCycle(rect1, speed=0.4, colors=[MAGENTA, ORANGE])
comet = Comet(rect1, speed=0.01, color=PURPLE, tail_length=10, bounce=True)
chase = Chase(rect1, speed=0.1, size=3, spacing=6, color=WHITE)
pulse = Pulse(rect1, speed=0.1, period=3, color=AMBER)
sparkle = Sparkle(rect1, speed=0.1, color=PURPLE, num_sparkles=10)
solid = Solid(rect1, color=JADE)
rainbow = Rainbow(rect1, speed=0.1, period=2)
sparkle_pulse = SparklePulse(rect1, speed=0.1, period=3, color=JADE)
rainbow_comet = RainbowComet(rect1, speed=0.1, tail_length=7, bounce=True)
rainbow_chase = RainbowChase(rect1, speed=0.1, size=3, spacing=2, step=8)
rainbow_sparkle = RainbowSparkle(rect1, speed=0.1, num_sparkles=15)
custom_color_chase = CustomColorChase(rect1,
                                      speed=0.1,
                                      size=2,
                                      spacing=3,
                                      colors=[ORANGE, WHITE, JADE])

animations = AnimationSequence(
    comet,
    blink,
    rainbow_sparkle,
    chase,
    pulse,