Neopixel on ATtiny3216¶
Library¶
NOT WORK WELL
- Adafruit_NeoPixel
- FastLED
Works - tinyNeoPixel.h
tinyNeoPixel.h is installed from https://github.com/SpenceKonde/megaTinyCore, when setting up megaTinyCore board manager for AVR 1-Series.
In https://github.com/SpenceKonde/megaTinyCore, there is document about NeoPixel (WS2812) support.
The usual NeoPixel (WS2812) libraries have problems on these parts.
This core includes two libraries for this, both of which are tightly based on the Adafruit_NeoPixel library.
See the tinyNeoPixel documentation and included examples for more information.
As of 2.0.1, these libraries are split into three versions specific to the part to eliminate the use of an additional submenu option.
tinyNeoPixel - a megaAVR compatible library for WS2812 “NeoPixel” and similar
- the classic AVRs to megaAVR causes many of the existing WS2812 libraries to not work on the megaAVR parts.
- support for 10MHz and 20MHz clock speeds.
- must use the correct library for the port that the pin you are using
- two versions of this libraries
- tinyNeoPixel
- implements the entire API that Adafruit_NeoPixel does
- must be on the same port
- tinyNeoPixel_Static
- removing the option to change the length at runtime, and instead of using malloc() to dynamically allocate the pixel buffer
- begin() is removed entirely
- reduce flash
Samples¶
library¶
#include <tinyNeoPixel.h>
Arduio library path: /Users/yuichitamiya/Documents/Arduino/libraries
“Inclued” Library will go to here.
tinyNeoPixel.h is installed with board, so place to store is different.
tinyNeoPixel.h path: /Users/yuichitamiya/Library/Arduino15/packages/megaTinyCore/hardware/megaavr/1.1.5/libraries/tinyNeoPixel
when you compile¶
change
#include <tinyNeoPixel.h>
to
#include "tinyNeoPixel.h"
data pin¶
Notice in strandtest.ino¶
File > Examples > tinyNeoPixel > strandtest
IMPORTANT:
To reduce NeoPixel burnout risk,
add 1000 uF capacitor across pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input
and minimize distance between Arduino and first pixel.
Avoid connecting on a live circuit...if you must, connect GND first.