The seesaw firmware that ships with the ATtiny817 breakout includes the ability to power up to 60 NeoPixels on one pin. This example displays a rainbow across a NeoPixel ring.

Follow the instructions on the Python & CircuitPython page to get set up.

NeoPixel Pins

There are 15 pins on the ATtiny817 breakout that can be used for powering NeoPixels. However, you can only use one pin at a time! The available pins are:

  • 0, 1, 2, 3, 20, 5, 6, 7, 8, 9, 12, 13, 14, 18, 19
Pins 15, 16 and 17 can NOT be used as NeoPixel pins with the seesaw firmware!

Wiring

As stated above, you can use many different pins for powering NeoPixels, but this example uses pin 19. Connect a NeoPixel ring (or strip) to the breakout as follows.

  • Use a STEMMA QT cable to connect the STEMMA QT connector on the Feather to the STEMMA QT connector on the breakout.
  • Connect NeoPixel ring GND to breakout GND
  • Connect NeoPixel ring IN (data in) to breakout pin 19
  • Connect NeoPIxel ring power to breakout VIN

Example Code

Update your code.py to the following.

# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT

# Simple seesaw test writing NeoPixels
# Can use any valid GPIO pin, up to 60 pixels!
#
# See the seesaw Learn Guide for wiring details.
# For SAMD09:
# https://learn.adafruit.com/adafruit-seesaw-atsamd09-breakout?view=all#circuitpython-wiring-and-test
# For ATtiny8x7:
# https://learn.adafruit.com/adafruit-attiny817-seesaw/neopixel

import time
import board
from rainbowio import colorwheel
from adafruit_seesaw import seesaw, neopixel

ss = seesaw.Seesaw(board.I2C())

NEOPIXEL_PIN = 19  # Can be any pin
NEOPIXEL_NUM = 12  # No more than 60 pixels!

pixels = neopixel.NeoPixel(ss, NEOPIXEL_PIN, NEOPIXEL_NUM)
pixels.brightness = 0.3  # Not so bright!

color_offset = 0  # Start at red

# Cycle through all colors along the ring
while True:
    for i in range(NEOPIXEL_NUM):
        rc_index = (i * 256 // NEOPIXEL_NUM) + color_offset
        pixels[i] = colorwheel(rc_index & 255)
    color_offset += 1
    time.sleep(0.01)

The NeoPixel ring lights up in a rainbow!

First you import all the necessary modules and libraries. Then you instantiate the seesaw on I2C.

Next, you set the NeoPixel pin, and the number of pixels to match your wiring and pixel number. This example uses pin 19 and a 12-pixel ring.

Then, you create the pixels object with the pin and number you set above.

Before the loop, you set pixel brightness to 30% and create a color_offset variable and set it to 0 to start the colorwheel at red.

Inside the loop, you display the rainbow with a slight delay. Increase this to slow down the rainbow if desired.

That's all there is to using CircuitPython seesaw NeoPixel with the ATtiny817 breakout!

This guide was first published on Oct 20, 2021. It was last updated on 2021-10-20 12:04:17 -0400.

This page (NeoPixel) was last updated on Nov 20, 2021.

Text editor powered by tinymce.