I just bought a Gemma M0 and I'm trying to use it with FastLED. There are several forums that discuss the same errors I get when I try to upload my code, but they all involve editing .h files, something I'm not comfortable doing without understanding the reason behind the change. Is there a place where I can get a basic starting point for using FastLED with the Gemma M0?

I tried the Quick Example in the FastLED Overview:

#include "FastLED.h" CRGB leds[1];

void setup() { 
  FastLED.addLeds<NEOPIXEL, 6>(leds, 1); }

void loop() { 
  leds[0] = CRGB::White; FastLED.show(); delay(30); 
  leds[0] = CRGB::Black; FastLED.show(); delay(30); }

and I get these errors:

Arduino: 1.8.13 (Mac OS X), Board: "Adafruit Gemma M0, Small (-Os) (standard), Arduino, Off"
In file included from /Users/jaireaux/Documents/Arduino/blink/blink.ino:1:
/Users/jaireaux/Documents/Arduino/libraries/FastLED/src/FastLED.h:14:21: note: #pragma message: FastLED version 3.004.000
   14 | #    pragma message "FastLED version 3.004.000"
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/jaireaux/Documents/Arduino/libraries/FastLED/src/FastLED.h:65,
                 from /Users/jaireaux/Documents/Arduino/blink/blink.ino:1:
/Users/jaireaux/Documents/Arduino/libraries/FastLED/src/fastspi.h:135:23: note: #pragma message: No hardware SPI pins defined.  All SPI access will default to bitbanged output
  135 | #      pragma message "No hardware SPI pins defined.  All SPI access will default to bitbanged output"
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/jaireaux/Documents/Arduino/libraries/FastLED/src/FastLED.h:48,
                 from /Users/jaireaux/Documents/Arduino/blink/blink.ino:1:
/Users/jaireaux/Documents/Arduino/libraries/FastLED/src/fastpin.h: In instantiation of 'class FastPin<6>':
/Users/jaireaux/Documents/Arduino/libraries/FastLED/src/fastpin.h:242:29:   required from 'class FastPinBB<6>'
/Users/jaireaux/Documents/Arduino/libraries/FastLED/src/platforms/arm/d21/clockless_arm_d21.h:10:54:   required from 'class ClocklessController<6, 12, 30, 18, GRB, 0, false, 50>'
/Users/jaireaux/Documents/Arduino/libraries/FastLED/src/chipsets.h:578:7:   required from 'class WS2812Controller800Khz<6, GRB>'
/Users/jaireaux/Documents/Arduino/libraries/FastLED/src/FastLED.h:92:34:   required from 'class NEOPIXEL<6>'
/Users/jaireaux/Documents/Arduino/libraries/FastLED/src/FastLED.h:314:28:   required from 'static CLEDController& CFastLED::addLeds(CRGB*, int, int) [with CHIPSET = NEOPIXEL; unsigned char DATA_PIN = 6]'
/Users/jaireaux/Documents/Arduino/blink/blink.ino:4:60:   required from here
/Users/jaireaux/Documents/Arduino/libraries/FastLED/src/fastpin.h:210:24: error: static assertion failed: Invalid pin specified
  210 |  static_assert(validpin(), "Invalid pin specified");
      |                ~~~~~~~~^~
exit status 1
Error compiling for board Adafruit Gemma M0.

Thanks in advance for your help.

  • starting point... example code in the arduino IDE
    – jsotola
    Oct 27 '21 at 1:31
  • 1
    The Arduino IDE Examples don’t cover the difference between types of hardware. Oct 28 '21 at 15:58

The Gemma does not have a pin 6. FastLED.addLeds<NEOPIXEL, 6>(leds, 1); I changed to pin 2 and it works. FastLED.addLeds<NEOPIXEL, 2>(leds, 1);

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.