0

Tiled DotStar Matrix (8x32) with Metro Express M0
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Tiled DotStar Matrix (8x32) with Metro Express M0

by banggeulhan on Tue Jan 12, 2021 5:35 pm

Hello,

I recently purchased the Adafruit Metro Express M0 board and five 8x32 DotStar LED Matrices. I have the matrices chained and working with the Arduino DotStarMatrix library example code (tiletest). But I noticed that the speed of the scrolling is considerably slower compared to it running just one matrix. I'm wondering if there are some ways to improve the speed - I looked this up online and the discussions and suggestions I was able to find were mostly around CircuitPython, which I don't plan to use, and as far as I can tell, Arduino is supposed to be faster? (Please correct me if I'm wrong.) Any suggestions that may improve the speed would be appreciated. Thanks.

banggeulhan
 
Posts: 2
Joined: Thu Mar 14, 2019 5:15 pm

Re: Tiled DotStar Matrix (8x32) with Metro Express M0

by dastels on Wed Jan 13, 2021 11:20 am

5 matrices are going to take 5 times longer to update than 1 since the data stream has to travel the length of it with each update. There's not a lot you can do about that other than make sure your code s using a DMA based update.

Yes, C++ is far faster than CircuitPython. For many hobby project this doesn't matter, but for some it's crucial.

It's hard to give advice without seeing the code. If you post it you might get some good feedback.

Dave

dastels
 
Posts: 4858
Joined: Tue Oct 20, 2015 3:22 pm

Re: Tiled DotStar Matrix (8x32) with Metro Express M0

by banggeulhan on Wed Jan 13, 2021 10:27 pm

Here's the code - straight from the example really.

Code: Select all | TOGGLE FULL SIZE
Adafruit_DotStarMatrix matrix = Adafruit_DotStarMatrix(
  (uint8_t)32, (uint8_t)8, 5, 1, DATAPIN, CLOCKPIN,
  DS_TILE_TOP   + DS_TILE_LEFT   + DS_TILE_ROWS   + DS_TILE_PROGRESSIVE +
  DS_MATRIX_TOP + DS_MATRIX_LEFT + DS_MATRIX_COLUMNS + DS_MATRIX_ZIGZAG,
  DOTSTAR_BRG);
//Adafruit_DotStarMatrix matrix = Adafruit_DotStarMatrix(
//  (uint8_t)10, (uint8_t)8, 3, 1,
//  DS_TILE_TOP   + DS_TILE_LEFT   + DS_TILE_ROWS   + DS_TILE_PROGRESSIVE +
//  DS_MATRIX_TOP + DS_MATRIX_LEFT + DS_MATRIX_ROWS + DS_MATRIX_ZIGZAG,
//  DOTSTAR_BRG);

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

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

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

void loop() {
  matrix.fillScreen(0);
  matrix.setCursor(x, 0);
  matrix.print(F("Howdy"));
  if(--x < -36) {
    x = matrix.width();
    if(++pass >= 3) pass = 0;
    matrix.setTextColor(colors[pass]);
  }
  matrix.show();
  delay(100);
}


I saw from the CircuitPython discussion, setting the brightness less than 1 (I guess in this case 100?) can cause some slowdown. Would this be the case here as well? Any little tips would be much appreciated.

banggeulhan
 
Posts: 2
Joined: Thu Mar 14, 2019 5:15 pm

Re: Tiled DotStar Matrix (8x32) with Metro Express M0

by dastels on Thu Jan 14, 2021 12:20 pm

Brightness could definitely have an effect. If it's not full brightness every R, G, and B value has to be scaled. That's 3 computations for each DotStar. Try it.

Other than that nothing jumps out... there's not much happening in the loop. You could try cranking up the performance optimization in the compiler. This doesn't seem to be exposed in Arduino. It looks like you can fiddle with it though. I found this: https://forum.arduino.cc/index.php?topic=488370.0, specifically the last post. Look at your Arduino/hardware/Adafruit/samd/platform.txt file for what they are talking about for setting optimization flags. I find that (unsurprisingly) the reference lines numbers are off, but close.

Dave

dastels
 
Posts: 4858
Joined: Tue Oct 20, 2015 3:22 pm

Please be positive and constructive with your questions and comments.