FeatureDemo help with Teensy4.1, SmartLED Sheild 4 V5, Adafruit 32x32 LED matrix

Hi!

I’m trying to get started with the FeatureDemo. I’ve installed the latest Arduino IDE, SmartMatrix 4.0.3 libary, teensyduino 1.59.

Using this 32x32 LED matrix from Adafruit: 32x32 RGB LED Matrix Panel - 5mm Pitch : ID 2026 : Adafruit Industries, Unique & fun DIY electronics and kits

I’m following Getting Started with the SmartLED Shield for Teensy - SparkFun Learn

1: I noticed that the LED matrix appears to be powered by the shield, which doesn’t jive with the docs.

2: With the FeatureDemo code compiled and loaded on the Teensy, it appears that the demo code is running, but I only get two rows of LEDs illuminated (the top row and the 17th row).

How can I debug this?

Thank you!

Hi, can you please post a picture of the back of the panel showing how everything is installed and wired?

Two rows lit means the matrix isn’t being refreshed and just displaying random pixels

The panel should be powered by an external supply but if that’s no present it will draw current from wherever it can get it, like the shield’s buffers.

Thank you for the quick response, Louis!

Thanks for explaining about the external power supply, that makes sense.

Here’s one picture of the back with everything installed.

The labels on the shield 2x8 pins don’t seem to match what is on the LED matrix, so that might be the problem. I’ll try to confirm the pinout on the LED matrix.

And the back of the LED matrix without the shield piggy-backed onto the 2x8 pins:

I don’t see any problems with the placement or pin out. I can’t tell from the picture, but maybe some of the soldering on the pins looks like it hasn’t reflowed properly. Can you take a closer look, and maybe send a picture of the soldering on the Teensy pins from closer?

Are you sure your sketch is actually loaded and running? You can add a serial.print() inside your sketch if there’s not already one there so you can use the serial monitor and check that it’s running.

Thanks for the ideas. I added a Serial.print() and see the message in the Serial Monitor; I am sure the code is executing.

I’ll double check all the soldering and will update with my results.

Thanks again for the great support.

Hmm, I just tried on a second teensy board, and I even confirmed continuity from the teensy pins to the breakout pins on the shield, still the same two rows lit up on the LED matrix.

I see this comment in the FeatureDemo code:
// Teensy 3.0 has the LED on pin 13
const int ledPin = 13;

Is that the correct value for a Teensy4.1, too?

That code is basically ignored on a Teensy 4.x

Can you please paste the top part of your sketch so I can see if there’s any issues with the config?

It’s essentially the FeatureDemo #define USE_ADAFRUIT_GFX_LAYERS and #include <MatrixHardware_Teensy4_ShieldV5.h> uncommented. I believe the default constants kMatrixWidth, kMatrixHeight, and kPanelType are what I want to use.

/*
  SmartMatrix Features Demo - Louis Beaudoin (Pixelmatix)
  This example code is released into the public domain

  (New in SmartMatrix Library 4.0) To update a SmartMatrix Library sketch to use Adafruit_GFX compatible layers:

  - Make sure you have the Adafruit_GFX Library installed in Arduino (you can use Arduino Library Manager)
  - add `#define USE_ADAFRUIT_GFX_LAYERS` at top of sketch (this is needed for any sketch to tell SmartMatrix Library that Adafruit_GFX is present, not just this sketch)
    - Add this *before* #include <SmartMatrix.h>
    - Check the documentation Wiki for more details on why you may or may not want to use these layers
*/

#define USE_ADAFRUIT_GFX_LAYERS

// uncomment one line to select your MatrixHardware configuration - configuration header needs to be included before <SmartMatrix.h>
//#include <MatrixHardware_Teensy3_ShieldV4.h>        // SmartLED Shield for Teensy 3 (V4)
#include <MatrixHardware_Teensy4_ShieldV5.h>        // SmartLED Shield for Teensy 4 (V5)
//#include <MatrixHardware_Teensy3_ShieldV1toV3.h>    // SmartMatrix Shield for Teensy 3 V1-V3
//#include <MatrixHardware_Teensy4_ShieldV4Adapter.h> // Teensy 4 Adapter attached to SmartLED Shield for Teensy 3 (V4)
//#include <MatrixHardware_ESP32_V0.h>                // This file contains multiple ESP32 hardware configurations, edit the file to define GPIOPINOUT (or add #define GPIOPINOUT with a hardcoded number before this #include)
//#include "MatrixHardware_Custom.h"                  // Copy an existing MatrixHardware file to your Sketch directory, rename, customize, and you can include it like this
#include <SmartMatrix.h>

#define COLOR_DEPTH 24                  // Choose the color depth used for storing pixels in the layers: 24 or 48 (24 is good for most sketches - If the sketch uses type `rgb24` directly, COLOR_DEPTH must be 24)
const uint16_t kMatrixWidth = 32;       // Set to the width of your display, must be a multiple of 8
const uint16_t kMatrixHeight = 32;      // Set to the height of your display
const uint8_t kRefreshDepth = 36;       // Tradeoff of color quality vs refresh rate, max brightness, and RAM usage.  36 is typically good, drop down to 24 if you need to.  On Teensy, multiples of 3, up to 48: 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48.  On ESP32: 24, 36, 48
const uint8_t kDmaBufferRows = 4;       // known working: 2-4, use 2 to save RAM, more to keep from dropping frames and automatically lowering refresh rate.  (This isn't used on ESP32, leave as default)
const uint8_t kPanelType = SM_PANELTYPE_HUB75_32ROW_MOD16SCAN;   // Choose the configuration that matches your panels.  See more details in MatrixCommonHub75.h and the docs: https://github.com/pixelmatix/SmartMatrix/wiki
const uint32_t kMatrixOptions = (SM_HUB75_OPTIONS_NONE);        // see docs for options: https://github.com/pixelmatix/SmartMatrix/wiki
const uint8_t kBackgroundLayerOptions = (SM_BACKGROUND_OPTIONS_NONE);
const uint8_t kScrollingLayerOptions = (SM_SCROLLING_OPTIONS_NONE);
const uint8_t kIndexedLayerOptions = (SM_INDEXED_OPTIONS_NONE);

SMARTMATRIX_ALLOCATE_BUFFERS(matrix, kMatrixWidth, kMatrixHeight, kRefreshDepth, kDmaBufferRows, kPanelType, kMatrixOptions);

SMARTMATRIX_ALLOCATE_BACKGROUND_LAYER(backgroundLayer, kMatrixWidth, kMatrixHeight, COLOR_DEPTH, kBackgroundLayerOptions);

#ifdef USE_ADAFRUIT_GFX_LAYERS
  // there's not enough allocated memory to hold the long strings used by this sketch by default, this increases the memory, but it may not be large enough
  SMARTMATRIX_ALLOCATE_GFX_MONO_LAYER(scrollingLayer, kMatrixWidth, kMatrixHeight, 6*1024, 1, COLOR_DEPTH, kScrollingLayerOptions);
#else
  SMARTMATRIX_ALLOCATE_SCROLLING_LAYER(scrollingLayer, kMatrixWidth, kMatrixHeight, COLOR_DEPTH, kScrollingLayerOptions);
#endif

SMARTMATRIX_ALLOCATE_INDEXED_LAYER(indexedLayer, kMatrixWidth, kMatrixHeight, COLOR_DEPTH, kIndexedLayerOptions);

#include "colorwheel.c"
#include "gimpbitmap.h"

const int defaultBrightness = (100*255)/100;        // full (100%) brightness
//const int defaultBrightness = (15*255)/100;       // dim: 15% brightness
const int defaultScrollOffset = 6;
const rgb24 defaultBackgroundColor = {0x40, 0, 0};

// Teensy 3.0 has the LED on pin 13
const int ledPin = 13;

Hmm, I’m running out of ideas. Can you try using a ribbon cable instead of directly attaching the shield to the panel?

I tried that too, with the same result. At least I’m not doing something obviously wrong. Maybe it’s the LED matrix? I’ll see if I can get some of the other LEDs to light up, if not I’ll see about exchanging it.

Thanks again for the support, I appreciate it! I’m excited to get this working, you’ve put together a really neat product.

As you’ve tried two Teensys, at this point it must be the shield or panel that is faulty. Hard to rule out one or the other without having spares to try. Hope you can get an exchange and get up and running soon!