Open atsu7 opened 4 years ago
Yes, the directions to build this are not clear. Yes, this is for a raspberry pi.
However, please look at the larger project https://github.com/Romonaga/rpiLightSystem you will find instructions for the larger project.
I copied the section that should be most important to you.
Or you can follow the below steps that achive the same thing.
sudo apt install git qt5-default libqt5sql5-mysql build-essential gcc make cmake cmake-gui cmake-curses-gui libssl-dev wiringpi libi2c-dev libcppunit-dev scons doxygen
Clone or download DNRLogger from this repo. https://github.com/Romonaga/DNRLogger
qmake .
make
sudo make install
Time to build the WS2811 support.
clone or download the rpi_ws281x lib from this repo. https://github.com/Romonaga/rpi_ws281x ** You must use the one from this repo, it has changes the wrapper needs. I am hoping my changes make it into the main repo at some point. **
run scons, this will build the lib.
sudo cp *.h /usr/local/include/.
sudo cp libws2811.a /usr/local/lib/.
Time to build the rpi-rgb-led-matrix
make
sudo cp lib/*.h /usr/local/include
sudo cp lib/*.a /usr/local/lib
Lets build my wrapper around that fantastic lib!
clone or download Ws2811Wrapper from this repo https://github.com/Romonaga/Ws2811Wrapper
run qmake .
make
sudo make install
Thank you very much. I followed your guide and built them successfully. By the way, how can I use their functions ? I want to learn how to write cpp file with this wrapper to turn on led-matrix.
This wrapper was built to support this project https://github.com/Romonaga/rpiLightSystem I would suggest that you examine https://github.com/Romonaga/rpiLightSystem/blob/master/src/lightsystem.cpp and examine function bool LightSystem::startSystem() This is where I do the initialization of the wrapper.
As to how to use this wrapper, there are many built in cpp classes to the rpiLightSystem. I suggest you examine the following for ideas as well as examples to use the API. There are examples of using LED Strips as well as matrix.
All of the code that manipulates LEDS or Matrix's are based on this Interface https://github.com/Romonaga/rpiLightSystem/blob/master/src/ilightshow.cpp
As you can see I have many helper functions in this class that you might be interested in.
For Matrix Check out https://github.com/Romonaga/rpiLightSystem/blob/master/src/matrixdisplayfile.cpp (This will show you how to use animated gifs) https://github.com/Romonaga/rpiLightSystem/blob/master/src/matrixscrolltext.cpp
I guess the question that I would have is what are you trying to build. Based on your GIT it appears that you have some python code that will drive them, but refresh is to slow. https://github.com/atsu7/neopixel_movieplayer_python
If your intent is to improve upon that, then I am not sure that my wrapper is what you need, as at this point I have not added the support for video (I am working on it.").
The https://github.com/hzeller/rpi-rgb-led-matrix project is far more powerful then the fraction of it I exposed in my wrapper, and if I am guessing correctly, my wrapper might not expose all the functionality you need to stream video at this time. However, if you look at the examples, if I am not mistaken, it shows how the lib can be used to display video.
What I can say, while I have had good luck with animated gif's I am interested to see if video playback frustrates would be to slow.
Thank you for your response. My goal is to play .mp4 file on neopixel matrix with c++ (because I want to use opencv and other c++ libs). I'm going to make function to read movie with opencv, so I just want a function like "setPixelColer[i][color]" . How can I use the function in my cpp file?
Sorry, have been busy. But, assuming you are using this lib and using a matrix, you would need to use void Ws2811Wrapper::setPixelColor(u_int32_t row, u_int32_t pixel, ws2811_led_t value)
row, col, color.
I'm sorry for posting a basic question. I would love to use this wrapper, but I don't have idea how to use this. I put these files in the directory rpi_ws281x, and added files in rpi-rgb-led-matrix/lib (Are they needed?). I tried
g++ ws2811wrapper.cpp
but errors happened.How can I build them? Do I need qt and qmake on raspberrypi?