I have an Adafruit Trinket (5v, 16mhz, based off of the AtTiny85 chip), and am wishing to use it with a strip with 24 3 pin, individually addressable LEDs (WS2812B). When I try to compile my code, I get this error: static_assert(validpin(), "Invalid pin specified"); I've tried using different pins, but of them are seeming to work. What can I do to fix this issue? Here's my current code:

#include <FastLED.h>
#define LEDCOUNT 24
#define DATAPIN 0


void setup() {
  FastLED.addLeds<WS2812B, LEDCOUNT>(leds, LEDCOUNT);

void loop() {
  leds[0] = CRGB::Red;

I think what @IgnacioVazquez-Abrams is getting at is:

void setup() {
  FastLED.addLeds<WS2812B, LEDCOUNT>(leds, LEDCOUNT);

Has LEDCOUNT showing up for both the number of LEDs and the data pin identifier.


void setup() {
  FastLED.addLeds<WS2812B, DATAPIN, GRB>(leds, LEDCOUNT);

This puts DATAPIN in the right place, and also adds the color order typical for WS2812B, GRB

  • Tried this. Still got an error. – MazeOfEncryption Nov 17 '17 at 2:34
  • "No hardware SPI pins defined. All SPI access will default to bitbanged output" – MazeOfEncryption Nov 17 '17 at 2:35
  • Wait.. it worked though. – MazeOfEncryption Nov 17 '17 at 2:36
  • 1
    That's just a warning, not an error. ATTiny doesn't have hardware SPI that FastLED can use. – jose can u c Nov 17 '17 at 2:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.