Can't get 16x16 Matrix to work fully?

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
keithschaub
 
Posts: 10
Joined: Mon Aug 10, 2020 1:51 pm

Can't get 16x16 Matrix to work fully?

Post by keithschaub »

pic of it streaming with the setting 16x16, but you can see it is 7x16 for whatever reason, not sure.
pic of it streaming with the setting 16x16, but you can see it is 7x16 for whatever reason, not sure.
matrix.PNG (391.77 KiB) Viewed 223 times
I can only get 8x16 to display when using the Adafruit_NeoMatrix library. I tried many different combinations, but the best I could get was 8.16 (see below).
Am I doing something wrong, or it fundamentally doesn't support 16x16.
(The matrix is ALL ONE PIECE). I ordered it from BTF-Lighting. Here's the link to it if needed.

[url]]https://www.amazon.com/BTF-LIGHTING-0-4 ... 8461&psc=1[/url


// Adafruit_NeoMatrix example for single NeoPixel Shield.
// Scrolls 'Howdy' across the matrix in a portrait (vertical) orientation.

#include <Adafruit_GFX.h>
#include <Adafruit_NeoMatrix.h>
#include <Adafruit_NeoPixel.h>
#ifndef PSTR
#define PSTR // Make Arduino Due happy
#endif

#define PIN 6

// MATRIX DECLARATION:
// Parameter 1 = width of NeoPixel matrix
// Parameter 2 = height of matrix
// Parameter 3 = pin number (most are valid)
// Parameter 4 = matrix layout flags, add together as needed:
// NEO_MATRIX_TOP, NEO_MATRIX_BOTTOM, NEO_MATRIX_LEFT, NEO_MATRIX_RIGHT:
// Position of the FIRST LED in the matrix; pick two, e.g.
// NEO_MATRIX_TOP + NEO_MATRIX_LEFT for the top-left corner.
// NEO_MATRIX_ROWS, NEO_MATRIX_COLUMNS: LEDs are arranged in horizontal
// rows or in vertical columns, respectively; pick one or the other.
// NEO_MATRIX_PROGRESSIVE, NEO_MATRIX_ZIGZAG: all rows/columns proceed
// in the same order, or alternate lines reverse direction; pick one.
// See example below for these values in action.
// Parameter 5 = pixel type flags, add together as needed:
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
// NEO_GRBW Pixels are wired for GRBW bitstream (RGB+W NeoPixel products)
// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)


// Example for NeoPixel Shield. In this application we'd like to use it
// as a 5x8 tall matrix, with the USB port positioned at the top of the
// Arduino. When held that way, the first pixel is at the top right, and
// lines are arranged in columns, progressive order. The shield uses
// 800 KHz (v2) pixels that expect GRB color data.

//Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(7, 8, PIN,
// NEO_MATRIX_TOP + NEO_MATRIX_LEFT +
// NEO_MATRIX_ROWS + NEO_MATRIX_ZIGZAG,
// NEO_GRB + NEO_KHZ800);

Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(16,16, PIN,
NEO_MATRIX_TOP + NEO_MATRIX_LEFT +
NEO_MATRIX_COLUMNS + NEO_MATRIX_ZIGZAG,
NEO_GRB + NEO_KHZ800);

const uint16_t colors[] = {
matrix.Color(255, 0, 0), matrix.Color(0, 255, 0), matrix.Color(0, 0, 255) };

void setup() {
matrix.begin();
matrix.setTextWrap(false);
matrix.setBrightness(40);
matrix.setTextColor(colors[0]);
}

int x = matrix.width();
int pass = 0;

void loop() {
matrix.fillScreen(0);
matrix.setCursor(x, 0);
//matrix.print(F("If you can read this, please answer the question: are you male?"));
//matrix.print(F("IIIIII"));
matrix.print(F("HELLO"));
if(--x < -120) {
x = matrix.width();
if(++pass >= 3) pass = 0;
matrix.setTextColor(colors[pass]);
//matrix.setTextColor(colors[2]);
}
matrix.show();
delay(100);
}

User avatar
keithschaub
 
Posts: 10
Joined: Mon Aug 10, 2020 1:51 pm

Re: Can't get 16x16 Matrix to work fully?

Post by keithschaub »

Also, just to make sure there's nothing wrong with the h/w...Here's a photo of a 16x16 that I could upload and display properly.

// Adafruit_NeoMatrix example for single NeoPixel Shield.
// Scrolls 'Howdy' across the matrix in a portrait (vertical) orientation.

#include <Adafruit_GFX.h>
#include <Adafruit_NeoMatrix.h>
#include <Adafruit_NeoPixel.h>
#ifndef PSTR
#define PSTR // Make Arduino Due happy
#endif

#define PIN 6

// MATRIX DECLARATION:
// Parameter 1 = width of NeoPixel matrix
// Parameter 2 = height of matrix
// Parameter 3 = pin number (most are valid)
// Parameter 4 = matrix layout flags, add together as needed:
// NEO_MATRIX_TOP, NEO_MATRIX_BOTTOM, NEO_MATRIX_LEFT, NEO_MATRIX_RIGHT:
// Position of the FIRST LED in the matrix; pick two, e.g.
// NEO_MATRIX_TOP + NEO_MATRIX_LEFT for the top-left corner.
// NEO_MATRIX_ROWS, NEO_MATRIX_COLUMNS: LEDs are arranged in horizontal
// rows or in vertical columns, respectively; pick one or the other.
// NEO_MATRIX_PROGRESSIVE, NEO_MATRIX_ZIGZAG: all rows/columns proceed
// in the same order, or alternate lines reverse direction; pick one.
// See example below for these values in action.
// Parameter 5 = pixel type flags, add together as needed:
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
// NEO_GRBW Pixels are wired for GRBW bitstream (RGB+W NeoPixel products)
// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)


// Example for NeoPixel Shield. In this application we'd like to use it
// as a 5x8 tall matrix, with the USB port positioned at the top of the
// Arduino. When held that way, the first pixel is at the top right, and
// lines are arranged in columns, progressive order. The shield uses
// 800 KHz (v2) pixels that expect GRB color data.

//Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(7, 8, PIN,
// NEO_MATRIX_TOP + NEO_MATRIX_LEFT +
// NEO_MATRIX_ROWS + NEO_MATRIX_ZIGZAG,
// NEO_GRB + NEO_KHZ800);

Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(16,16, PIN,
NEO_MATRIX_TOP + NEO_MATRIX_LEFT +
NEO_MATRIX_COLUMNS + NEO_MATRIX_ZIGZAG,
NEO_GRB + NEO_KHZ800);

const uint16_t colors[] = {
matrix.Color(255, 0, 0), matrix.Color(0, 255, 0), matrix.Color(0, 0, 255) };

const unsigned short ironMan16x16[240] PROGMEM={
0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xAD55, 0x6B4D, 0x6B4D, 0x6B4D, 0xA534, 0xF7BE, 0xF7BE, 0xF79E, 0xF7BE, 0xF7BE, // 0x0010 (16) pixels
0xF7BE, 0xF7BE, 0xFFFF, 0xFFFF, 0x84B2, 0x2A8A, 0x61C7, 0x8924, 0x8945, 0x8924, 0x61C7, 0x2AAA, 0x84B2, 0xFFFF, 0xFFDF, 0xF7BE, // 0x0020 (32) pixels
0xF7BE, 0xFFFF, 0xFFFF, 0x7CB2, 0x6125, 0x80C4, 0xD9A7, 0xFA49, 0xFA8A, 0xFA6A, 0xE146, 0x8000, 0x68A3, 0x7CD3, 0xFFFF, 0xF7BE, // 0x0030 (48) pixels
0xF7BE, 0xFFFF, 0x7430, 0x6925, 0xE9CA, 0xFD0C, 0xFB68, 0xF8E6, 0xF966, 0xF0C5, 0xF2C6, 0xFC28, 0xE044, 0x4842, 0x7451, 0xF7BE, // 0x0040 (64) pixels
0xF7BE, 0xFFFF, 0x0925, 0x98C6, 0xFCAC, 0xFF26, 0xFE04, 0xFA66, 0xE846, 0xD246, 0xEE66, 0xFEE5, 0xFB05, 0x7000, 0x0966, 0xF7BE, // 0x0050 (80) pixels
0xF7BE, 0x7430, 0x7106, 0xEC48, 0xFF07, 0xFF23, 0xFF43, 0xFE04, 0xFC64, 0xFE04, 0xFFA5, 0xFF43, 0xFE43, 0xC242, 0x4843, 0x8C71, // 0x0060 (96) pixels
0xF7BE, 0x00A2, 0xB8E7, 0xFE8A, 0xFF84, 0x8322, 0x18C1, 0xA423, 0xFF24, 0xA443, 0x18C1, 0x8343, 0xFEE3, 0xEC22, 0x7800, 0x4A49, // 0x0070 (112) pixels
0xF7BE, 0x00E3, 0xB927, 0xFEAA, 0xFF84, 0xB463, 0x72E2, 0xCCE3, 0xFEC4, 0xCD03, 0x72E2, 0xBCA4, 0xFF03, 0xEC42, 0x7801, 0x4A49, // 0x0080 (128) pixels
0xF7BE, 0x00A2, 0xB947, 0xFB6A, 0xFE26, 0xFF24, 0xFEC4, 0xFEA4, 0xFE84, 0xFEA4, 0xFEE4, 0xFEA3, 0xF4E3, 0xD9C3, 0x8000, 0x4A49, // 0x0090 (144) pixels
0xF7BE, 0x9514, 0x4966, 0xD025, 0xFD68, 0xFF45, 0xFE83, 0xFEE4, 0xFF04, 0xFEE4, 0xFEC4, 0xFE63, 0xDB82, 0x8803, 0x30C3, 0xA514, // 0x00A0 (160) pixels
0xF7BE, 0xFFFF, 0x0986, 0xA001, 0xFDE8, 0xFFC5, 0x8B62, 0x2901, 0x3142, 0x2901, 0x8B83, 0xFF23, 0xF443, 0x6800, 0x1185, 0xF7BE, // 0x00B0 (176) pixels
0xF7BE, 0xFFFF, 0x9514, 0x4063, 0xD1E4, 0xFEE7, 0xD604, 0x8C02, 0x8C42, 0x8C02, 0xCD83, 0xFDA4, 0x9921, 0x3042, 0x9534, 0xF79E, // 0x00C0 (192) pixels
0xF79E, 0xFFFF, 0xFFFF, 0x9D76, 0x4864, 0x4100, 0xC343, 0xFBE5, 0xFC26, 0xFC06, 0xC303, 0x2860, 0x3023, 0x9D76, 0xFFFF, 0xF7BE, // 0x00D0 (208) pixels
0xF7BE, 0xF79E, 0xFFDF, 0xFFFF, 0x8CB3, 0x3A8B, 0x48A4, 0x5000, 0x5000, 0x5000, 0x50A4, 0x42AC, 0x8C92, 0xFFFF, 0xFFDF, 0xF7BE, // 0x00E0 (224) pixels
0xF7BE, 0xF7BE, 0xF79E, 0xF7BE, 0xF7BE, 0xF7BE, 0xAD55, 0x6B6D, 0x6B6D, 0x6B6D, 0xA534, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, // 0x00F0 (240) pixels
};

const unsigned short mario16x16[256] PROGMEM={
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFF7D, 0xE041, 0xD841, 0xD000, 0xC800, 0xC800, 0xC082, 0xFFBE, 0xFFDF, 0xFFDF, 0xFFFF, 0xFFFF, // 0x0010 (16) pixels
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xE000, 0xF800, 0xF800, 0xF800, 0xF800, 0xF800, 0xF000, 0xB000, 0xA800, 0xB000, 0xFFFF, 0xFFFF, // 0x0020 (32) pixels
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x29E1, 0x2A84, 0x4366, 0xBF57, 0xCFB8, 0xDFF9, 0x0000, 0xE7F9, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0030 (48) pixels
0xFFFF, 0xFFFF, 0xFFFF, 0x1000, 0xFFBB, 0x51C1, 0xFF59, 0xDE97, 0xE655, 0xF6D6, 0x0001, 0xE674, 0xDDF2, 0xB4AD, 0xFFFF, 0xFFFF, // 0x0040 (64) pixels
0xFFFF, 0xFFFF, 0xFFFF, 0x1000, 0xFFBB, 0x5A02, 0xEED7, 0xDE55, 0xDE55, 0xF717, 0xEEB6, 0x0000, 0xFF37, 0xC550, 0xC52F, 0xFFFF, // 0x0050 (80) pixels
0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x28A0, 0xCDB2, 0xEEB6, 0xD614, 0xD5F3, 0xDE54, 0x0000, 0x0001, 0x0042, 0x0000, 0xFFFF, 0xFFFF, // 0x0060 (96) pixels
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xDED3, 0xDF58, 0xDEF4, 0xCED5, 0xE6D3, 0xE716, 0xFF54, 0xE632, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0070 (112) pixels
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xD000, 0xD800, 0x08DF, 0xD800, 0xD800, 0xE800, 0x001F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0080 (128) pixels
0xFFFF, 0xFFFF, 0xFFFF, 0xE000, 0xF800, 0xF800, 0x19FF, 0xF800, 0xF800, 0x1A1F, 0xF000, 0xE000, 0xD800, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0090 (144) pixels
0xFFFF, 0xFFFF, 0xE000, 0xF800, 0xF800, 0xF800, 0x21BF, 0x315F, 0x213F, 0x217D, 0xF800, 0xF800, 0xF800, 0xC800, 0xFFFF, 0xFFFF, // 0x00A0 (160) pixels
0xFFFF, 0xFFFF, 0xADB0, 0xCFFA, 0xF800, 0x111F, 0xFFE0, 0x491E, 0x4958, 0xFFE0, 0x005B, 0xF800, 0xC7FB, 0xADD1, 0xFFFF, 0xFFFF, // 0x00B0 (176) pixels
0xFFFF, 0xFFFF, 0xBD0E, 0xE777, 0xDEF0, 0x289F, 0x491E, 0x40DC, 0x40FA, 0x38B9, 0x1878, 0xE751, 0xE777, 0xBD0F, 0xFFFF, 0xFFFF, // 0x00C0 (192) pixels
0xFFFF, 0xFFFF, 0xBD0E, 0xDE2F, 0x181C, 0x597F, 0x48FC, 0x38B7, 0x3896, 0x40F9, 0x40D8, 0x0815, 0xE670, 0xC52E, 0xFFFF, 0xFFFF, // 0x00D0 (208) pixels
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x281F, 0x491F, 0x303A, 0xFFFF, 0xFFFF, 0x1015, 0x30B9, 0x2819, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x00E0 (224) pixels
0xFFFF, 0xFFFF, 0xFFFF, 0x4120, 0x72C1, 0x7B20, 0x30A0, 0xFFFF, 0xFFFF, 0x4120, 0x8341, 0x6240, 0x30A0, 0xFFFF, 0xFFFF, 0xFFFF, // 0x00F0 (240) pixels
0xFFFF, 0xFFFF, 0x6A85, 0x6265, 0x6244, 0x5A03, 0x5A04, 0xFFFF, 0xF7BE, 0x5A24, 0x5A03, 0x51E3, 0x49A2, 0x41A3, 0xFFFF, 0xFFFF, // 0x0100 (256) pixels
};

const unsigned short ks1[144] PROGMEM={
0xE737, 0xF7BC, 0xF77C, 0xC594, 0x93CE, 0xA491, 0xE6DA, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xB4D1, 0x4964, 0x6A48, 0x59C6, 0x49A5, // 0x0010 (16) pixels
0xFFFF, 0xFFFF, 0xDE99, 0x3924, 0xB471, 0xCCF3, 0xEDD7, 0xEDF8, 0xC556, 0x5A69, 0xB596, 0xACD2, 0x8B0B, 0xEDD6, 0xD4D3, 0xD534, // 0x0020 (32) pixels
0xE5D8, 0xE5F8, 0xAC0F, 0x83CF, 0x9430, 0xDCD1, 0xD4D3, 0xC4B2, 0xC4B3, 0xCCD3, 0xCCB2, 0xC40E, 0x732D, 0x8BAE, 0xDCF0, 0xC470, // 0x0030 (48) pixels
0xC4B2, 0xC514, 0xC4F4, 0xC471, 0xAB8C, 0x7B4D, 0x93CE, 0xE552, 0xD514, 0xBC71, 0xCCD3, 0xCCD3, 0xC471, 0xC470, 0x8BAE, 0xAC0F, // 0x0040 (64) pixels
0xD4F2, 0x728A, 0x4903, 0x92EA, 0x7A27, 0x4144, 0x938E, 0x93CF, 0xB491, 0xA36D, 0x6A6A, 0x6A6A, 0xCC92, 0xA38E, 0x5A08, 0x7A69, // 0x0050 (80) pixels
0x9BCF, 0xBD13, 0xDCF4, 0xD535, 0xC451, 0xE515, 0xCCD3, 0xBC10, 0xDC93, 0xAC31, 0xBD55, 0xBBAD, 0x9AEB, 0x92EB, 0xCC31, 0xAB8E, // 0x0060 (96) pixels
0x8AAA, 0x92AA, 0x9C31, 0xB555, 0x9B8C, 0x61A6, 0xAB8E, 0x824A, 0x828A, 0x930C, 0x61C5, 0x9C72, 0xB556, 0xAC91, 0x934C, 0x92EC, // 0x0070 (112) pixels
0x830C, 0x7AAC, 0x92CB, 0x8B4C, 0xA4D3, 0xB555, 0xBB0D, 0x9BCD, 0xB3EF, 0x92AC, 0x92CC, 0xABCD, 0x49C8, 0x6B0E, 0x82CE, 0x8887, // 0x0080 (128) pixels
0x9BCD, 0xB451, 0xC431, 0xBC51, 0xA42F, 0x2002, 0x18C5, 0x3107, 0x68C6, 0x6967, 0x8B0B, 0x934D, 0x8B0C, 0x8B2C, 0x58C6, 0x1084, // 0x0090 (144) pixels
};

void setup() {
matrix.begin();
matrix.setTextWrap(false);
matrix.setBrightness(40);
matrix.setTextColor(colors[0]);
}

int x = matrix.width();
int pass = 0;

void loop() {
//matrix.fillScreen(0);
//matrix.setCursor(x, 0);

// matrix.clear();
// matrix.drawRGBBitmap(0, 0, (const uint16_t *)ks1, 16, 16);
// matrix.show();
// delay(3000);

matrix.drawRGBBitmap(0, 0, (const uint16_t *)ironMan16x16, 16, 16);
matrix.show();
delay(3000);

matrix.clear();
matrix.drawRGBBitmap(0, 0, (const uint16_t *)mario16x16, 16, 16);
matrix.show();
delay(3000);


//
// //matrix.print(F("If you can read this, please answer the question: are you male?"));
// //matrix.print(F("IIIIII"));
// matrix.print(F("HELLO PEOPLE OF WILLIS"));
// if(--x < -120) {
// x = matrix.width();
// if(++pass >= 3) pass = 0;
// matrix.setTextColor(colors[pass]);
// //matrix.setTextColor(colors[2]);
// }
// matrix.show();
// delay(100);
}
Attachments
ironManDebug.jpg
ironManDebug.jpg (121.29 KiB) Viewed 217 times

User avatar
adafruit_support_carter
 
Posts: 29483
Joined: Tue Nov 29, 2016 2:45 pm

Re: Can't get 16x16 Matrix to work fully?

Post by adafruit_support_carter »

It looks like it's working? For the first example, that's just the size of the font being used.

User avatar
keithschaub
 
Posts: 10
Joined: Mon Aug 10, 2020 1:51 pm

Re: Can't get 16x16 Matrix to work fully?

Post by keithschaub »

Thanks for your response.
Is there a way to increase the size of the font so that it uses more of the 16 rows? (It only uses 7).

User avatar
adafruit_support_carter
 
Posts: 29483
Joined: Tue Nov 29, 2016 2:45 pm

Re: Can't get 16x16 Matrix to work fully?

Post by adafruit_support_carter »

There's no scaling of fonts available. So you'll just need to swap to using a different size font:
https://learn.adafruit.com/adafruit-gfx ... sing-fonts

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”