Winio
March 23, 2020, 10:00pm
1
Hi. I need a rather small (code size) function / library to render a 64x64 multidimensional array (informations for every pixel) to a 64x64 hub75e led matrix. No graphical functions, like shapes or text needed, only the renderer, with full collor support. I scanned the smartmatrix code alot, but I couldnt extract my needed code.
I would appreciate some help.
Sebastian
Louis
March 25, 2020, 12:35pm
2
Take a look at the FastLED_Functions example, which efficiently writes RGB data to the background layer.
SmartMatrix::GFX will give you a 2D array in which you just write your 24bpp pixels and do matrix->show() when done.
or more specifically
b = map(b, 0, 15, 0, 31);
g = map(g, 0, 15, 0, 63);
r = map(r, 0, 15, 0, 31);
//Serial.print(r);
//Serial.print("/");
//Serial.print(g);
//Serial.print("/");
//Serial.print(b);
RGB_bmp_fixed[pixel] = (r << 11) + (g << 5) + b;
//Serial.print(" -> ");
//Serial.println(RGB_bmp_fixed[pixel], HEX);
}
matrix->drawRGBBitmap(x, y, RGB_bmp_fixed, w, h);
}
// In a case of a tile of neomatrices, this test is helpful to make sure that the
// pixels are all in sequence (to check your wiring order and the tile options you
// gave to the constructor).
// This also counts as another speed test that measures how fast matrix->show, is.
// 4096 pixels, 55 seconds, 74 frames per second.
// without the pixel copies, it takes 54 seconds, almost as fast.
or simpler even, you can simply write to
matrixleds[matrix->XY(x,y)] = 0xFFAA55