Skip to content

Commit b9acf30

Browse files
authored
Merge pull request #24 from FoamyGuy/neopixels_example
add neopixels only example
2 parents 19eb032 + 8615a31 commit b9acf30

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

examples/fruitjam_neopixels.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 Tim Cocks for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
import time
5+
6+
from adafruit_fruitjam.peripherals import Peripherals
7+
8+
colors = [0xFF00FF, 0xFFFF00, 0x00FF00]
9+
10+
fruitjam = Peripherals()
11+
fruitjam.neopixels.brightness = 0.1
12+
13+
while True:
14+
fruitjam.neopixels.fill(colors[0])
15+
time.sleep(0.3)
16+
fruitjam.neopixels.fill(colors[1])
17+
time.sleep(0.3)
18+
fruitjam.neopixels.fill(colors[2])
19+
time.sleep(0.3)
20+
fruitjam.neopixels.fill(0x000000)
21+
22+
for i in range(5):
23+
fruitjam.neopixels[i] = colors[i % len(colors)]
24+
time.sleep(0.1)

0 commit comments

Comments
 (0)