hzeller / rpi-rgb-led-matrix

Controlling up to three chains of 64x64, 32x32, 16x32 or similar RGB LED displays using Raspberry Pi GPIO
GNU General Public License v2.0
3.59k stars 1.15k forks source link

Adafruit HUB 75 Hat, -DRGB_CLASSIC_PINOUT option #51

Closed magdesign closed 9 years ago

magdesign commented 9 years ago

Hi

I'm using an old Adafruit HUB75 Hat to drive the LED matrix. So I must compile your code using the classic wiring option ( -DRGB_CLASSIC_PINOUT)

But I could not figure out where I have to write these -DRGB_CLASSIC_PINOUT arguments. I guess somewhere in the Makefile.....

Thanks for your help!

hzeller commented 9 years ago

If you are using the Adafruit HAT, then you actually need to give -DADAFRUIT_RGBMATRIX_HAT

Have a look in lib/Makefile, there are the options to switch on/off.

hzeller commented 9 years ago

(and let me know if it works, because I don't have a Adafruit HAT to test, so I just implemented that pin-mapping looking at their description)

magdesign commented 9 years ago

Thanks for your help. I uncommented the option and tried to compile, but there is an error, here is what I get:

g++ -Iinclude -Wall -O3 -g -c -o demo-main.o demo-main.cc make -C lib make[1]: Entering directory '/home/pi/rpi-rgb-led-matrix/lib' g++ -I../include -Wall -O3 -g -fPIC -DADAFRUIT_RGBMATRIX_HAT -c -o gpio.o gpio.cc g++ -I../include -Wall -O3 -g -fPIC -DADAFRUIT_RGBMATRIX_HAT -c -o led-matrix.o led-matrix.cc g++ -I../include -Wall -O3 -g -fPIC -DADAFRUIT_RGBMATRIX_HAT -c -o framebuffer.o framebuffer.cc framebuffer.cc: In constructor ‘rgb_matrix::internal::Framebuffer::Framebuffer(int, int, int)’: framebuffer.cc:49:1: error: uninitialized member ‘rgbmatrix::internal::Framebuffer::parallel’ with ‘const’ type ‘const int’ [-fpermissive] framebuffer.cc: In static member function ‘static void rgb_matrix::internal::Framebuffer::InitGPIO(rgbmatrix::GPIO, int)’: framebuffer.cc:83:10: error: ‘struct rgb_matrix::internal::Framebuffer::IoBits::’ has no member named ‘output_enable_rev1’ framebuffer.cc:83:38: error: ‘struct rgb_matrix::internal::Framebuffer::IoBits::’ has no member named ‘output_enable_rev2’ framebuffer.cc:84:10: error: ‘struct rgb_matrix::internal::Framebuffer::IoBits::’ has no member named ‘clock_rev1’ framebuffer.cc:84:30: error: ‘struct rgb_matrix::internal::Framebuffer::IoBits::’ has no member named ‘clock_rev2’ framebuffer.cc:115:27: error: ‘struct rgb_matrix::internal::Framebuffer::IoBits::’ has no member named ‘output_enable_rev1’ framebuffer.cc:116:31: error: ‘struct rgb_matrix::internal::Framebuffer::IoBits::’ has no member named ‘output_enable_rev2’ framebuffer.cc: In member function ‘void rgb_matrix::internal::Framebuffer::DumpToMatrix(rgbmatrix::GPIO)’: framebuffer.cc:324:23: error: ‘struct rgb_matrix::internal::Framebuffer::IoBits::’ has no member named ‘clock_rev1’ framebuffer.cc:324:56: error: ‘struct rgb_matrix::internal::Framebuffer::IoBits::’ has no member named ‘clock_rev2’ framebuffer.cc:333:14: error: ‘struct rgb_matrix::internal::Framebuffer::IoBits::’ has no member named ‘clock_rev1’ framebuffer.cc:333:38: error: ‘struct rgb_matrix::internal::Framebuffer::IoBits::’ has no member named ‘clock_rev2’ Makefile:61: recipe for target 'framebuffer.o' failed make[1]: * [framebuffer.o] Error 1 make[1]: Leaving directory '/home/pi/rpi-rgb-led-matrix/lib' Makefile:23: recipe for target 'lib/librgbmatrix.a' failed make: * [lib/librgbmatrix.a] Error 2

hzeller commented 9 years ago

Uh, give me a minute to fix that ...

hzeller commented 9 years ago

Ok, do a pull and try again ...

magdesign commented 9 years ago

Thanks for your hi-speed support!

Compilation works fine and also the ./led-matrix runs smoothly with 4 LED matrix on a HUB75 Adafruit Hat.

I think you can close the issue.

hzeller commented 9 years ago

Cool.