PlatformIO Community

Adafruit NeoTrellis M4

Just wondering if anyone anywhere is using this device with Platform.io ??

There are some Library problems if I try and use one of the Adafruit code examples from their www … mostly around USBMIDI … but for my application, fortunately, I don’t need that.

I havent really analyzed exactly what is going on yet but basically I am finding all kinds of weirdness. For the moment, just trying to get something very simple to run.

initialize and light up a few neopixels thats all !!

The same thing compiles and runs just fine if I build it with Arduino 1.8.6 but I REALLY don’t want to have to go back to the Arduino toolchain to start building what might become a fairly complex app.

BTW I am running on OSX using VScode.

So what’s the exact problem? The same firmware code build in the Arduino IDE but doesn’t in PIO? Or it does compile but doesn’t run properly? What is the code, the platformio.ini, the working behavior and the non-working behavior?

So as I originally explained I havent really analysed the problem at all, not yet anyway.
The question is to find out whether this board is properly supported within platform IDE and if anyone else is having any problems with it.
At this moment I don’t have too much time to spend on sorting it out.

I tried running some of the Adafruit examples from github . e.g.

There are problems when pulling in the AdaFruit_NeoTrellisM4.h library as this links to many other libraries including MIDIUSB which complains mainly about USB endpoints either missing or duplicated. Right now I dont need USB or MIDI in any case so I have moved on to a MUCH more basic example !!

So code looks like this …

#include <Arduino.h>
#include <Adafruit_NeoPixel.h>

#define PIN 10

Adafruit_NeoPixel strip = Adafruit_NeoPixel(32, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'
  strip.setBrightness(100);

  //setup neopixel panel lights
  strip.setPixelColor(1,strip.Color(0,0,255));
  strip.setPixelColor(2,strip.Color(255,0,0));
  strip.setPixelColor(3,strip.Color(255,0,255));
  strip.setPixelColor(4,strip.Color(0,255,0));
  strip.setPixelColor(5,strip.Color(0,255,255));
  strip.setPixelColor(6,strip.Color(255,255,0));
  strip.setPixelColor(7,strip.Color(255,255,255));

  strip.setPixelColor(9,strip.Color(0,0,255));
  strip.setPixelColor(10,strip.Color(255,0,0));
  strip.setPixelColor(11,strip.Color(255,0,255));
  strip.setPixelColor(12,strip.Color(0,255,0));
  strip.setPixelColor(13,strip.Color(0,255,255));
  strip.setPixelColor(14,strip.Color(255,255,0));
  strip.setPixelColor(15,strip.Color(255,255,255));
  strip.show();  
}

void loop() {
//  // Some example procedures showing how to display to the pixels:
//  colorWipe(strip.Color(0, 0, 255), 20); // Blu
//  colorWipe(strip.Color(255, 0, 0), 20); // red
//  colorWipe(strip.Color(255, 0, 255), 20); // mag
//    colorWipe(strip.Color(0, 255, 0), 20); // grn
//  colorWipe(strip.Color(0, 255, 255), 20); // cyn
//  colorWipe(strip.Color(255, 255, 0), 20); // yel
//  colorWipe(strip.Color(255,255,255), 20); // White 
//  // Send a theater pixel chase in...
//  theaterChase(strip.Color(127, 127, 127), 50); // White
//  theaterChase(strip.Color(127, 0, 0), 50); // Red
//  theaterChase(strip.Color(0, 0, 127), 50); // Blue
//
//  rainbow(20);
//  rainbowCycle(20);
//  theaterChaseRainbow(50);
}

All this does is setup up a few lights … I have removed all of the fancy stuff from the main loop . [part of Adafruit demo]

my platform.ini looks like this …

; Please visit documentation for the other options and examples

; https://docs.platformio.org/page/projectconf.html

[env:adafruit_trellis_m4]

platform = atmelsam

board = adafruit_trellis_m4

framework = arduino

upload_port = /dev/cu.usbmodem1441201

– And I have the Adafruit NeoPixel library installed locally

Basically compile is fine … no reported problems or complaints.
Upload seems to work but is a bit flakey as I have to reset the board first.
However result is Nothing works at all and the board goes offline so probably something missing somewhere.

As described EXACTLY the same code produces the expected result if compiled and uploaded from Arduino … upload is still a bit flakey though !!

I dont mind working on this to get to the bottom of it but right now I have to get something very basic working in a few days just for a concept demo… I will probably just do it with Arduino for now.

In a couple of weeks I will have time in which case a few pointers or suggestions would be great !!!