0

Trinket M0 with FastLED
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: Trinket M0 with FastLED

by abchand on Tue Nov 28, 2017 3:22 am

+1 to daan1234's question above.

I'm likewise trying to control the onboard Dotstar of the Trinket M0 with Arduino/FastLED, and encountering compile errors related to unmapped pins when they are set to 7 and 8 (even when using the latest FastLED library fork linked above). Any help is much appreciated.

--------------------

Edit: inspired by Dance_Mark's intrepid work earlier in the thread, I did some tinkering and got this running. I edited the Trinket M0 definition in my local copy of fastpin_arm_d21.h to include:

#define MAX_PIN 8
_DEFPIN_ARM( 0, 0, 8); _DEFPIN_ARM( 1, 0, 2); _DEFPIN_ARM( 2, 0, 9);
_DEFPIN_ARM( 3, 0, 7); _DEFPIN_ARM( 4, 0, 6); _DEFPIN_ARM( 8, 0, 1); _DEFPIN_ARM( 7, 0, 0);

abchand
 
Posts: 1
Joined: Sat Mar 14, 2015 6:20 pm

Re: Trinket M0 with FastLED

by moritz on Thu Jul 26, 2018 3:25 pm

I seem to have the same issue with an ItsyBitsy M0 - the fastled code does not compile and gives a pin error:

error: static assertion failed: Invalid pin specified
exit status 1
Error compiling for board Adafruit ItsyBitsy M0.

Any ideas what needs to be adjusted here? Thanks!!!

moritz
 
Posts: 5
Joined: Tue Dec 02, 2014 10:39 am

Re: Trinket M0 with FastLED

by trevco on Tue Oct 23, 2018 11:11 pm

Heyo -- deep into Halloween costume prep, had a brief moment of panic, but after much searching I found the pin to ATSAMD21 mappings for the ItsyBitsy M0 and added the following code to the fastpin_arm_d21.h file (as abchand did for his Trinket M0 solve):

Code: Select all | TOGGLE FULL SIZE
#elif defined(ADAFRUIT_ITSYBITSY_M0)

#define MAX_PIN 14
_DEFPIN_ARM( 2, 0, 14); _DEFPIN_ARM( 3, 0, 9); _DEFPIN_ARM( 4, 0, 8);
_DEFPIN_ARM( 5, 0, 15); _DEFPIN_ARM( 6, 0, 20); _DEFPIN_ARM( 7, 0, 21);
_DEFPIN_ARM( 8, 0, 6); _DEFPIN_ARM( 9, 0, 7); _DEFPIN_ARM( 10, 0, 18);
_DEFPIN_ARM( 11, 0, 16); _DEFPIN_ARM( 12, 0, 19); _DEFPIN_ARM( 13, 0, 17);
_DEFPIN_ARM( 29, 0, 10); // MOSI
_DEFPIN_ARM( 30, 0, 11); // SCK

#define SPI_DATA  29
#define SPI_CLOCK 30

#define HAS_HARDWARE_PIN_SUPPORT 1

Disclaimer that I've only tested this for pins 7 and 13, the ones that I'm using. I'm attaching my updated fastpin_arm_d21.h for ref, as well as the ItsyBitsy M0 board definition file I used for pin reference.

Hope this is helpful to someone!
Attachments
variant.cpp
(18.3 KiB) Downloaded 24 times
fastpin_arm_d21.h
(9.29 KiB) Downloaded 29 times

trevco
 
Posts: 1
Joined: Thu Oct 27, 2016 12:34 am

Re: Trinket M0 with FastLED

by Dance_Marks on Mon Nov 19, 2018 12:29 pm

Thank trevco! All that's missing are the pins for the on-board DotStar.

This is the complete definition :

Code: Select all | TOGGLE FULL SIZE
#elif defined(ADAFRUIT_ITSYBITSY_M0)

#define MAX_PIN 16
_DEFPIN_ARM( 2, 0, 14); _DEFPIN_ARM( 3, 0, 9); _DEFPIN_ARM( 4, 0, 8);
_DEFPIN_ARM( 5, 0, 15); _DEFPIN_ARM( 6, 0, 20); _DEFPIN_ARM( 7, 0, 21);
_DEFPIN_ARM( 8, 0, 6); _DEFPIN_ARM( 9, 0, 7); _DEFPIN_ARM( 10, 0, 18);
_DEFPIN_ARM( 11, 0, 16); _DEFPIN_ARM( 12, 0, 19); _DEFPIN_ARM( 13, 0, 17);
_DEFPIN_ARM( 29, 0, 10); // MOSI
_DEFPIN_ARM( 30, 0, 11); // SCK
_DEFPIN_ARM( 40, 0, 0); //On-Board DotStar Clock
_DEFPIN_ARM( 41, 0, 1); //On-Board DotStar Data

#define SPI_DATA  29
#define SPI_CLOCK 30

#define HAS_HARDWARE_PIN_SUPPORT 1


To use the on-board DotStar : FastLED.addLeds<APA102, 41, 40>(M0DotStar, 1);

Dance_Marks
 
Posts: 84
Joined: Mon Sep 22, 2014 11:29 am

Please be positive and constructive with your questions and comments.