Skip to content

Can't use on-board LED on Adafruit QT Py SAMD21 #1354

Closed

Description

@thnikk

The built-in neopixel on the QT Py SAMD21 (pin 11) is not working with FastLED. When compiling, I get this error:

In file included from .pio/libdeps/2k-touch/FastLED/src/FastLED.h:50,
                 from src/main.cpp:5:
.pio/libdeps/2k-touch/FastLED/src/fastpin.h: In instantiation of 'class FastPin<11>':
.pio/libdeps/2k-touch/FastLED/src/fastpin.h:242:29:   required from 'class FastPinBB<11>'
.pio/libdeps/2k-touch/FastLED/src/platforms/arm/d21/clockless_arm_d21.h:10:54:   required from 'class ClocklessController<11, 12, 30, 18, GRB, 0, false, 50>'
.pio/libdeps/2k-touch/FastLED/src/chipsets.h:578:7:   required from 'class WS2812Controller800Khz<11, GRB>'
Compiling .pio/build/2k-touch/lib496/Adafruit_TinyUSB_Arduino/arduino/ports/nrf/Adafruit_TinyUSB_nrf.cpp.o
.pio/libdeps/2k-touch/FastLED/src/FastLED.h:94:34:   required from 'class NEOPIXEL<11>'
.pio/libdeps/2k-touch/FastLED/src/FastLED.h:316:28:   required from 'static CLEDController& CFastLED::addLeds(CRGB*, int, int) [with CHIPSET = NEOPIXEL; unsigned char DATA_PIN = 11]'
src/main.cpp:94:52:   required from here
.pio/libdeps/2k-touch/FastLED/src/fastpin.h:210:24: error: static assertion failed: Invalid pin specified
  210 |  static_assert(validpin(), "Invalid pin specified");

I'm using platformio, but the same thing happens with the RGBSetDemo using the Arduino IDE.

Activity

  1. marmilicious commented on Jan 21, 2022

    @marmilicious
    Contributor

    There was another Adafruit board, I think the Bluefruit, and to specify the pin for the onboard pixels, instead of 8 or 11, etc, it was PIN_NEOPIXEL. You might give that a try.

  2. thnikk commented on Jan 21, 2022

    @thnikk
    Author

    I actually tried it right before posting this issue and it returns the same error. I checked the variant.h file for the board since I know there are usually pin definitions in there and it's defined as pin 11.

  3. Spegs21 commented on Feb 7, 2022

    @Spegs21

    @thnikk The pin definition is missing in fastpin_arm_d21.h:

    #elif defined(ADAFRUIT_QTPY_M0)

    You need to add _FL_DEEPIN(11,18,0); in the #elif block and change #define MAX_PIN 10 to #define MAX_PIN 11.

  4. Sheepybloke2-0 commented on Mar 12, 2022

    @Sheepybloke2-0

    This issue that I found might also be relevant here: #1363 (comment)

  5. Brannan-repo commented on Mar 8, 2024

    @Brannan-repo

    _FL_DEEPIN

    Sorry to a stickler, but this took me a while to figure out you have a typo in your code, it should be _fl_deFpin, not 2 E's

  6. added
    type: bug
    platform: samd
    area: core
    status: stale
    status: triage
    on Apr 16, 2026
  7. zackees commented on Jun 3, 2026

    @zackees
    Member

    Tracked in FastLED/fbuild#386 for SAMD21 / SAMD51 fbuild platform/build support validation.

    That fbuild issue is scoped to board metadata, toolchain/backend support, and FastLED smoke-build evidence. Any remaining FastLED source/platform-code blocker should stay linked from both sides.

  8. zackees commented on Jun 3, 2026

    @zackees
    Member

    fbuild tracker: FastLED/fbuild#386

    Validated in the fbuild build tool. The QT Py M0 toolchain + Arduino core compile cleanly:

    • Fixture (new): tests/platform/qtpy_m0 (board = adafruit_qt_py_m0, MCU SAMD21E18A, variant qtpy_m0)
    • Toolchain: arm-none-eabi-gcc 15.2.1 + Adafruit ArduinoCore-samd 1.7.16 + CMSIS-Atmel 1.2.2
    • Quick build: 10.4 KB / 256 KB flash, 3.0 KB / 32 KB RAM
    • QTPY-specific defines wired: -DARDUINO_QTPY_M0, -DADAFRUIT_QTPY_M0, -D__SAMD21E18A__, -DARM_MATH_CM0PLUS, -DCRYSTALLESS

    This is FastLED-side, not a build/toolchain issue. The static_assert(validpin(), "Invalid pin specified") you hit is from src/platforms/arm/d21/fastpin_arm_d21.h — that header maps Arduino pin numbers to SAMD21 PORT/pin bits, and on the QT Py M0 pin 11 (the on-board NeoPixel) is not in the validpin table. Adding a _FL_DEFPIN(11, ...) entry for the QT Py M0's PA10 (or whatever the actual NeoPixel port pin is on the qtpy_m0 variant) in d21 would resolve this. The build tool side is green.

  9. moved this from Triage to Done in FastLED Trackeron Sep 1, 2026
  10. added a commit that references this issue on Sep 1, 2026
    619eb0b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreplatform: samdstatus: stalestatus: triagetype: bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions