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.67k stars 1.17k forks source link

Facing trouble while using the library into my own program and major flickering only to last matrix out of 10 #660

Closed Rzeiwald closed 6 years ago

Rzeiwald commented 6 years ago

Thank you for the great library provided for use. I am a newbie in raspberry and c/c++ programming so sorry if I mention any stupid questions. I am using raspberry pi 3B+ model and 64x32 led matrix. I have used your library for displaying text on the led matrix using canvas->SetPixel(2,9,0, 0, 255); I don't know how do I display the direct string on display so I am using SetPixel method :| I have managed to display all the text I want with the SetPixel method. one main issue I am facing is I have no idea how do I integrate your library in my sample code. I have posted my question and code on [stackoverflow ] also(https://stackoverflow.com/questions/51292856/how-to-combine-and-use-wiringpi-library-with-rpi-rgb-led-matrix-library)also

I am compliling code by entering g++ -o text-example text-example.cc -lwiringPi command plus also mentioned full path while including header files like #include "/home/pi/rpi-rgb-led-matrix/include/led-matrix.h" but getting errors mentioned below

/tmp/ccoNCX6j.o: In function main': text-example.cc:(.text+0x1fd0c): undefined reference to rgb_matrix::GPIO::GPIO()' text-example.cc:(.text+0x1fd1c): undefined reference to rgb_matrix::GPIO::Init(int)' text-example.cc:(.text+0x1fd7c): undefined reference to rgb_matrix::RGBMatrix::RGBMatrix(rgb_matrix::GPIO*, int, int, int)' collect2: error: ld returned 1 exit status

Second thing is that I don't know why only 10th led-matrix is flickering badly , I have connected 10 64x32 led matrix in chain all are displaying fine exept 10th. Display board image Please help.

hzeller commented 6 years ago

To write text, look at the DrawText() function provided in the graphics.h header. If you look at the text-example.cc you see how it is used.

For proper linking, have a look at the section describing how to integrate the library into your own project

If you use wiring-pi, you might need to test if that works as it also accesses the GPIO pins; you might need to play with the initialization sequence (matrix or wiring-pi setup first).

Connecting 10 64x32 in sequence might create timing issues, depending on the electronics of the matrix. You might want to try using a higher --led-slowdown-gpio value. It is better to have multiple parallel chains, than one long chain, as the refresh rate suffers with longer chains.