Teensy 3.6 + FastLED_NeoMatrix

2n3055

Well-known member
Hi,
A text matrix was working fine until I replaced my computer. After nothing the program crash during
FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
all libraries are updated.


The Hardare is working fine, tested with this code:

Code:
#include <Adafruit_NeoPixel.h>
 
Adafruit_NeoPixel strip = Adafruit_NeoPixel ( 10, 44, NEO_GRB + NEO_KHZ800 );
 
void setup ()
{
pinMode(45, OUTPUT);
digitalWrite(45, LOW);
  strip.begin (); //initialize strip
  strip.show (); //set all black
 
  randomSeed ( analogRead(0) );
}
 
void loop ()
{
  stripColor ( 255, 0, 0 ); //red
  delay ( 1000 ); //1 second delay
  stripColor ( 0, 255, 0 ); //green
  delay ( 1000 ); //1 second delay
  stripColor ( 0, 0, 255 ); //blue
  delay ( 1000 ); //1 second delay
 
  //5 seconds of random colors
  for ( int x=50; x>0; x-- ) {
    stripColor ( random(256), random(256), random(256) );
    delay ( 100 );
  }
}
 
//set all pixels on strip a given R G B value
void stripColor ( uint8_t r, uint8_t g, uint8_t b )
{
  for ( int i=0; i<strip.numPixels(); i++ ) {
    strip.setPixelColor ( i, r, g, b );
  } strip.show ();
}
}

The same with fastled_neomatrix the leds stay off.
Code:
#include <FastLED.h>
#include <FastLED_NeoMatrix.h>
#include <Adafruit_GFX.h>

#define LED_PIN 44
#define COLOR_ORDER GRB
#define CHIPSET WS2812
#define MATRIX_WIDTH 10
#define MATRIX_HEIGHT 1
#define NUM_LEDS (MATRIX_WIDTH * MATRIX_HEIGHT)

CRGB leds[NUM_LEDS];


FastLED_NeoMatrix *matrix = new FastLED_NeoMatrix(
  leds, MATRIX_WIDTH, MATRIX_HEIGHT,
  NEO_MATRIX_TOP + NEO_MATRIX_LEFT + NEO_MATRIX_ROWS + NEO_MATRIX_PROGRESSIVE);

void setup() {
  Serial.begin(9600);
  pinMode(45, OUTPUT);
  digitalWrite(45, LOW); //power the matrix

  FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
  matrix->begin();
  matrix->setBrightness(20);
  Serial.println("LED initialised");
}

void loop() {
  matrix->drawPixel(0, 0, matrix->Color(255, 0, 0));  // LED 0 red
  matrix->show();
  delay(500);
 matrix->drawPixel(0, 0, matrix->Color(0, 0, 0));
  matrix->show();
  delay(500);
}

Any idea what am I doing wrong ?

Thanks
 
Back
Top