adafruit / RGB-matrix-Panel

Arduino library and example code for the 16x32 RGB matrix panels in the shop
http://www.adafruit.com/products/420
302 stars 145 forks source link

Add support for the Arduino Leonardo (m32u4) #50

Open skywodd opened 5 years ago

skywodd commented 5 years ago

This commit add support for the Arduino Leonardo and other compatible boards with an ATMega32U4 microcontroller.

Changes: No change to the inline assembler code or timings were made, only a minor tweak of the memory layout was required. This modification should not have any impact on performance. It's just a bits position modification.

All modified code is wrapped with if defined(__AVR_ATmega32U4__) to avoid any compilation error on others platforms.

Known limitations: Will not work with the Adafruit RGB Matrix Shield in the default jumpers wiring configuration. Cutting the jumpers and rewiring is required.

Pinout is

CLK can be used with the pin D12, D6, D4, D3, D2 or D0 / D1 (if you don't plan to use Serial1).

A, B, C, D can be on any other pins, but D8, D9, D10 and D11 are recommended for easy wiring.

The new code was tested with a 32x32 matrix, all examples are working.