0

Trinket M0 with FastLED
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Trinket M0 with FastLED

by Dance_Marks on Fri Sep 22, 2017 1:49 pm

I know ladyada kindly updated the FastLED library for the Gemma M0, is there plans to do the same for the Trinket M0?

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

Re: Trinket M0 with FastLED

by adafruit_support_mike on Fri Sep 22, 2017 11:41 pm

They both use the same microcontroller (the SAMD21E), so the update should work for both.

adafruit_support_mike
 
Posts: 58856
Joined: Thu Feb 11, 2010 2:51 pm

Re: Trinket M0 with FastLED

by Dance_Marks on Mon Sep 25, 2017 7:21 pm

I updated to the latest version of FastLED to test this. I think I bricked my Trinket M0.

Arduino 1.8.3
FastLED 3.1.6

I verified my code with Gemma M0 and it worked. I tried to verify for Trinket M0 and it didn't work.

I got the error "Invalid pin specified". I looked it up and I figured the library really wasn't working with the Trinket M0.

So I dug a little and I found in the file \platforms\avr\fastpin_arm_d21.h and I edited this line :

#elif defined(ARDUINO_GEMMA_M0)

for

#elif defined(ARDUINO_TRINKET_M0)



I verified and it worked, so naturally I tried to upload to my Trinket M0..

I got this result : https://pastebin.com/DVTDGL6K

And now my Trinket's green light is lit, the DotStar is purple, and my computer says "USB Device not recognized" when I plug it in, and it doesn't show in either the device manager or the IDE anymore.

I had obviously no idea what I was doing so I take full responsibility, just don't try this at home.

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

Re: Trinket M0 with FastLED

by adafruit_support_mike on Mon Sep 25, 2017 11:48 pm

The SAMD21 bootloader memory is write-protected, so it should be pretty hard to damage through regular interaction with the IDE.

Does the Trinket's NeoPixel pulse red when you double-click the reset button?

adafruit_support_mike
 
Posts: 58856
Joined: Thu Feb 11, 2010 2:51 pm

Re: Trinket M0 with FastLED

by Dance_Marks on Tue Sep 26, 2017 7:13 pm

I double clicked the reset button and my computer recognizes the Trinket M0 again. Thanks!

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

Re: Trinket M0 with FastLED

by adafruit_support_mike on Tue Sep 26, 2017 11:23 pm

Glad to hear it. Happy hacking!

adafruit_support_mike
 
Posts: 58856
Joined: Thu Feb 11, 2010 2:51 pm

Re: Trinket M0 with FastLED

by Dance_Marks on Fri Sep 29, 2017 10:16 am

adafruit_support_mike wrote:They both use the same microcontroller (the SAMD21E), so the update should work for both.


The gemma update doesn't work with the Trinket. I tried to tweak the library myself, but my knowledge in this area is limited and I haven't had success. I feel like it wouldn't be too complicated though, I just can't put my finger on it.

I realize FastLED is not your library and updating it from your end is a courtesy, but if you have any idea it would be greatly appreciated. I can't wait to develop on the Trinket M0.

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

Re: Trinket M0 with FastLED

by adafruit_support_mike on Fri Sep 29, 2017 11:47 pm

Try downloading a fresh copy from here:

https://github.com/adafruit/FastLED

Ladyada just tweaked a couple of things a few days ago.

adafruit_support_mike
 
Posts: 58856
Joined: Thu Feb 11, 2010 2:51 pm

Re: Trinket M0 with FastLED

by Dance_Marks on Sun Oct 01, 2017 9:10 pm

adafruit_support_mike wrote:Try downloading a fresh copy from here:

https://github.com/adafruit/FastLED

Ladyada just tweaked a couple of things a few days ago.


I tried it already without success. The latest commit to fastpin_arm_d21.h works only for the Gemma, even if they use the same chip, because the _DEFPIN_ARM hasn't been added for the Trinket M0.
Last edited by Dance_Marks on Mon Oct 02, 2017 11:49 am, edited 1 time in total.

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

Re: Trinket M0 with FastLED

by adafruit_support_mike on Sun Oct 01, 2017 11:57 pm

Hmm.. I'll pass that along to the software team.

adafruit_support_mike
 
Posts: 58856
Joined: Thu Feb 11, 2010 2:51 pm

Re: Trinket M0 with FastLED

by Dance_Marks on Mon Oct 02, 2017 2:43 pm

adafruit_support_mike wrote:Hmm.. I'll pass that along to the software team.


I appreciate it thank you!

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

Re: Trinket M0 with FastLED

by adafruit2 on Tue Oct 03, 2017 6:30 pm

did a PR, for now you can use....
https://github.com/adafruit/FastLED

adafruit2
Site Admin
 
Posts: 18661
Joined: Fri Mar 11, 2005 7:36 pm

Re: Trinket M0 with FastLED

by Dance_Marks on Tue Oct 03, 2017 7:37 pm

adafruit2 wrote:did a PR, for now you can use....
https://github.com/adafruit/FastLED


It works now, thank you so much!

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

Re: Trinket M0 with FastLED

by kgizzi on Sun Oct 08, 2017 8:41 pm

I can verify the fix did work! Thank you very much!

If you are using PlatformIO, you will need to manually make the change to .piolibdeps/FastLED_ID126/platforms/arm/d21/fastpin_arm_d21.h until the FastLED library changes get synced down to PlatformIO.

kgizzi
 
Posts: 1
Joined: Tue Dec 16, 2014 9:40 pm

Re: Trinket M0 with FastLED

by daan1234 on Sun Nov 26, 2017 5:22 am

I followed the instructions above hoping to drive the on-board dotstar LED.
I use pin 7,8 for data and clock as in the documentation and get the invalid pin error. It seems that these two pins are not defined in fastpin_arm_21.h. Or is it something else?

daan1234
 
Posts: 1
Joined: Sun Feb 22, 2015 6:06 am

Please be positive and constructive with your questions and comments.