Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Adafruit Circuit Playground Express - SAMD21 w/different pins #500
We have a project trying to use the FastLED code on the SAMD21 with different pinouts. Looks like the Arduino IDE identifies it as an "ATSAMD21G18A".
It works with the older version of our device, the Adafruit Circuit Playground that has the 8-bit ATmega32u4. This is the source code we are using:
But the newer boards have an 32-bit SAMD21, using device ATSAMD21G18A. Same pinouts as the older versions of the Playground, and we are using the same code that attempts to change the INPUT. Just the CPU arch changes, and more sensors/inputs are available. Here's the errors we have:
Thanks @focalintent !
You are correct. It has different mappings (noticed from some I2C LCD examples I tried to get working and failed); as well as it is compiling and uploading, just using a different pin.
The thing is, this works with the PIN assignments on the older version of the board with the 8-bit CPU.
With the newer CPU, I've been able to run all other code examples that uses custom pins and libraries in the Playground ecosystem - which all use the same PINs.
I saw your notes here in issue #393 and thought that perhaps I should force the CPU to use
Considering the PIN assignments in code between the older 8-bit and newer 32-bit are the same (cause the existing examples continue to work), and considering the entire thing does build and get uploaded - could it be possible that this FastLED library is not accepting a simple thing like which PIN to listen to, or that a definition for what PIN to use is different on newer CPUs?
I'm wondering if assigning a PIN is different between the CPUs within FastLED's library. And if that's the case, what would "PIN 17" on the old 8-bit
I am also wondering since the errors (warnings?) state
Kind of shooting in the dark. I have a 6 year old girl that helped me build this today - and was disappointed that we couldn't get it working in the end.
The pin definitions are different for every platform and MCU. And because FastLED talks directly to the low level GPIO registers, for a board to be supported by FastLED a custom mapping of PIN numbers to low level GPIO registers needs to be made. This has been done for the version of the circuit playground with an atmega32u4 — it hasn’t been done for a D21 based circuit playground. This is why it isn’t working for you right now.
Ah. Is this done within the FastLED library? If so, could you point me to a little code for the atmega32u4? I'll see what I can do for a PR if I can figure it out. EDIT: I do see this: https://github.com/FastLED/FastLED/tree/master/platforms/arm/d21…
On Sun, Sep 17, 2017, 4:42 AM Daniel Garcia ***@***.***> wrote: The pin definitions are different for every platform and MCU. And because FastLED talks directly to the low level GPIO registers, for a board to be supported by FastLED a custom mapping of PIN numbers to low level GPIO registers needs to be made. This has been done for the version of the circuit playground with an atmega32u4 — it hasn’t been done for a D21 based circuit playground. This is why it isn’t working for you right now. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#500 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAGaFEsywIcSN_2IiQ8a6MywuBdjakAjks5sjNuDgaJpZM4PZ3qz> .
I've managed to patch the d21/fastpin_arm_d21.h to add the pins for the Adafruit Circuit Playground Express. I tested 3 Arduino pins (6, 8 & 9) and they work fine. I had to #define the ADAFRUIT_CIRCUITPLAYGROUND_M0 in the sketch (as workaround) and set the code block before the ARDUINO_SAMD_ZERO block or it would take precedence. I'm not sure where this should be defined, or if it is already defined what value it should have. I'm not familiar enough with Arduino to figure this out.
I'm trying to get an Adafruit Express running with this library. I get the pragma error message listed in the original post, but I have the latest library. The code compiles and downloads but doesn't run. I tried several examples with the FastLED and they all do the same. I also saw this message in the compile output:
Could that be the problem? If so how do I fix it?
The code is from Adafruit's Seashell project which used the classic board, but I have the express board whichI'd like to use.