Skip to content

Commit 45067ff

Browse files
authored
Merge pull request #2311 from adafruit/halloween_neon_signs
Adding halloween neon code
2 parents 30d0e99 + 6bc9796 commit 45067ff

File tree

3 files changed

+115
-0
lines changed

3 files changed

+115
-0
lines changed

Halloween_Neon_Signs/Ghost.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# SPDX-FileCopyrightText: 2022 Noe Ruiz for Adafruit Industries
2+
# SPDX-License-Identifier: MIT
3+
# Ghost with Glasses Neon Sign
4+
import board
5+
import neopixel
6+
from adafruit_led_animation.animation.blink import Blink
7+
from adafruit_led_animation.animation.comet import Comet
8+
from adafruit_led_animation.animation.chase import Chase
9+
from adafruit_led_animation.animation.pulse import Pulse
10+
from adafruit_led_animation.group import AnimationGroup
11+
from adafruit_led_animation.sequence import AnimationSequence
12+
from adafruit_led_animation import color
13+
14+
ghost_pixels = neopixel.NeoPixel(board.SDA, 90, brightness=0.5,
15+
auto_write=False, pixel_order=neopixel.RGB)
16+
glasses_pixels = neopixel.NeoPixel(board.SCL, 33, brightness=0.5,
17+
auto_write=False, pixel_order=neopixel.RGB)
18+
19+
animations = AnimationSequence(
20+
# Synchronized animations
21+
AnimationGroup(
22+
Chase(ghost_pixels,speed=0.02, color=color.CYAN, size=40, spacing=5),
23+
Blink(glasses_pixels, speed=.4, color=color.PURPLE),
24+
sync=False,
25+
),
26+
27+
# Sequential animations
28+
Pulse(glasses_pixels, speed=0.01, color=color.WHITE, period=2),
29+
30+
# Synchronized
31+
AnimationGroup(
32+
Pulse(glasses_pixels, speed=0.01, color=color.PURPLE, period=1),
33+
Comet(ghost_pixels, speed=0.01, color=color.CYAN, tail_length=50, bounce=False),
34+
sync=True,
35+
),
36+
37+
advance_interval=4.0,
38+
auto_clear=True,
39+
auto_reset=True,
40+
)
41+
42+
while True:
43+
animations.animate()

Halloween_Neon_Signs/Reaper.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# SPDX-FileCopyrightText: 2022 Noe Ruiz for Adafruit Industries
2+
# SPDX-License-Identifier: MIT
3+
# Grim Reaper and Moon Neon Sign
4+
import board
5+
import neopixel
6+
from adafruit_led_animation.animation.chase import Chase
7+
from adafruit_led_animation.animation.pulse import Pulse
8+
from adafruit_led_animation.group import AnimationGroup
9+
from adafruit_led_animation.sequence import AnimationSequence
10+
from adafruit_led_animation import color
11+
12+
knife_leds = neopixel.NeoPixel(board.SDA, 48, brightness=0.8,
13+
auto_write=False, pixel_order=neopixel.RGB)
14+
repear_leds = neopixel.NeoPixel(board.SCL, 60, brightness=0.8,
15+
auto_write=False, pixel_order=neopixel.RGB)
16+
17+
animations = AnimationSequence(
18+
19+
AnimationGroup(
20+
Chase(knife_leds, speed=0.02, color=color.PURPLE, spacing=12, size=40),
21+
Pulse(repear_leds, speed=0.01, color=color.GREEN, period=3),
22+
sync=True,
23+
),
24+
advance_interval=8.0,
25+
auto_clear=True,
26+
auto_reset=True,
27+
)
28+
29+
while True:
30+
animations.animate()

Halloween_Neon_Signs/Wolf.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# SPDX-FileCopyrightText: 2022 Noe Ruiz for Adafruit Industries
2+
# SPDX-License-Identifier: MIT
3+
# Werewolf and Moon Neon Sign
4+
import board
5+
import neopixel
6+
from adafruit_led_animation.animation.blink import Blink
7+
from adafruit_led_animation.animation.comet import Comet
8+
from adafruit_led_animation.animation.pulse import Pulse
9+
from adafruit_led_animation.group import AnimationGroup
10+
from adafruit_led_animation.sequence import AnimationSequence
11+
from adafruit_led_animation import color
12+
13+
moon_leds = neopixel.NeoPixel(board.SDA, 60, brightness=0.8,
14+
auto_write=False, pixel_order=neopixel.RGB)
15+
wolf_leds = neopixel.NeoPixel(board.SCL, 57, brightness=0.8,
16+
auto_write=False, pixel_order=neopixel.RGB)
17+
18+
animations = AnimationSequence(
19+
Blink(wolf_leds, speed=0.07, color=color.BLUE),
20+
Pulse(wolf_leds, speed=0.01, color=color.PURPLE, period=3),
21+
AnimationGroup(
22+
Pulse(wolf_leds, speed=0.01, color=color.PURPLE, period=3),
23+
Comet(moon_leds, speed=0.01, color=color.AMBER, tail_length=60, reverse=True),
24+
sync=True,
25+
),
26+
AnimationGroup(
27+
Pulse(wolf_leds, speed=0.01, color=color.PURPLE, period=3),
28+
Pulse(moon_leds, speed=0.01, color=color.AMBER, period=3),
29+
sync=True,
30+
),
31+
AnimationGroup(
32+
Pulse(wolf_leds, speed=0.01, color=color.PURPLE, period=3),
33+
Pulse(moon_leds, speed=0.01, color=color.AMBER, period=3),
34+
sync=True,
35+
),
36+
advance_interval=2.0,
37+
auto_clear=True,
38+
auto_reset=True,
39+
)
40+
41+
while True:
42+
animations.animate()

0 commit comments

Comments
 (0)