Porting from UNO to Teensy3.2

I’m using the Teensy3-shieldV4 Smart Matrix shield and Teensy 3.2 on an Adafruit 16x32 matrix display. I use the Adafruit display to mimic sketches I need for my bigger custom display (also 16x32 and using same logic as the Smart Matrix shield.)
I did a lot of playing around with the Adafruit display using an Arduino UNO and would like to use some of the example sketches that came with the library with the Teensy. The sketches were written for an UNO, using Adafruit’s RGBMatrixPanel library.
On the Teensy side I’m using the SmartMatrix library and Adafruit_GFX_Layers.
How do I modify code for UNO to use on the Teensy?
UNO uses D8,D9,D10 for for CLK, OE, and LAT, while Teensy uses D14,D4, D3. Row select on the UNO uses A0, A1, A2, while the Smart Matrix Shield for the Teensy generates these select lines from the on-board logic (a flip flop, 74374, I believe). The RGB pins are coded into the Adafruit library whereas the Teensy are not.
Both libraries and both displays (Adafruit and my custom one) follow HUB75 protocols/wiring.

Is it as simple as modifying the Adafruit library to match the pin numbers of the Teensy?

Hi Bob, it’s not trivial to port an RGBMatrixPanel sketch to SmartMatrix Library. You can’t use the RGBMatrixPanel with the shield. I don’t even know if there’s RGBMatrixPanel support for the Teensy, but the shield has a different circuit that definitely won’t work even if there is.

Take a look at the Adafruit GFX example in SmartMatrix Library, you may be able to use SmartMatrix Library and some of the RGBMatrixPanel interacting with the Background GFX layer.

You might also look at @marcmerlin’s library, he made a note here: https://github.com/pixelmatix/SmartMatrix/blob/master/MIGRATION.md#easy-porting-of-fastled-and-adafruitgfx-code-to-smartmatrix

@Louis actually with GFX support added to SmartMatrix (yours or mine), running code written for Adafruit’s lib works with very few modification on smartmatrix (outside of the panel init).



But to be clear, the adafruit lib won’t work on teensy, you have to use Louis’ lib, however once the init is done, mostly the same code should work.

I wrote both (as in I wrote one and modified it to run on 5 different backends), and the code is very similar.
@queenidog does that work for you?

Thanks guys. I will look this over to digest. But I’m starting to wonder if I’m overthinking this because when I look at some of the commands in Adafruit examples I see they are almost identical to the ones I’m using with SmartMatrix. eg, matrix.drawline and matrix.fillrect is pretty close to backgroundLayer.drawline or …fillRectangle. The parameters in the parentheses is the same. I’ll have to draw up a spreadsheet to compare the two.