Skip to content

Commit 213c7bc

Browse files
committed
neotest
1 parent 011fab0 commit 213c7bc

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

examples/seesaw_neopixel_test.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
# SPDX-License-Identifier: MIT
3+
4+
# Simple seesaw test writing NeoPixels
5+
# Can use any valid GPIO pin, up to 60 pixels!
6+
#
7+
# See the seesaw Learn Guide for wiring details:
8+
# https://learn.adafruit.com/adafruit-seesaw-atsamd09-breakout?view=all#circuitpython-wiring-and-test
9+
10+
import time
11+
import board
12+
from rainbowio import colorwheel
13+
from adafruit_seesaw import seesaw, neopixel
14+
15+
i2c_bus = board.I2C()
16+
ss = seesaw.Seesaw(i2c_bus)
17+
18+
NEOPIXEL_PIN = 6 # change to any pin
19+
NEOPIXEL_NUM = 30 # no more than 60!
20+
pixels = neopixel.NeoPixel(ss, NEOPIXEL_PIN, NEOPIXEL_NUM)
21+
pixels.brightness = 0.3 # not so brite!
22+
23+
color_offset = 0 # start at red
24+
25+
# cycle through all colors along the strip
26+
while True:
27+
for i in range(NEOPIXEL_NUM):
28+
rc_index = (i * 256 // NEOPIXEL_NUM) + color_offset
29+
pixels[i] = colorwheel(rc_index & 255)
30+
pixels.show()
31+
color_offset += 1
32+
time.sleep(0.01)

0 commit comments

Comments
 (0)