Demo code for 8x8 RGB LED Matrix Module
JohnZhong (SimplyTronics)
Posts: 9
Hello,
These are the demo code for 4 units of RGB LED Modules.
Before try this test code, please make sure you can run the test code for one module on the platform you are using.
Note: You really need a good power supply for 4 modules.
To run the test code for 4 modules, you have to set the Device ID and Pseudo Screen Size(PSS) before assemble them together and run the demo code on your microcontrollers.
Arduino users, please import the library to your software first. The instructions are in the _readme.txt files packed with source code.
Currently, I wrote three kinds of demo code: Spin for Propeller, C for Propeller and C for Arduino.
All the them have two kinds of code, one for changing the Device ID and PSS, and the other is the demo code.
Change the Device ID & PSS.
1) Connect ONLY one module to the microcontroller while running the code "ChangeDeviceID.xxx". See the detail information in the Product document.
2) Open the code "ChangeDeviceID.xxx" (Depends on the platform you are using).
Change the definition of the DeviceID and PSS for example C code for Arduino setting the Device ID to '0' and PSS to '15'.(The PSS would always be '15' in the demo code)
If after 5 second nothing change to the module, check your power and connections and try it again.
And I recommend to put a label to back side of the module.
4) Set the DeviceIDs of other modules to '1', '16', '17', follow the steps from 1) to 3), and do that again, until you change the DeviceID to '0', '1', '16', '17'.
These are the demo code for 4 units of RGB LED Modules.
Before try this test code, please make sure you can run the test code for one module on the platform you are using.
Note: You really need a good power supply for 4 modules.
To run the test code for 4 modules, you have to set the Device ID and Pseudo Screen Size(PSS) before assemble them together and run the demo code on your microcontrollers.
Arduino users, please import the library to your software first. The instructions are in the _readme.txt files packed with source code.
Currently, I wrote three kinds of demo code: Spin for Propeller, C for Propeller and C for Arduino.
All the them have two kinds of code, one for changing the Device ID and PSS, and the other is the demo code.
Change the Device ID & PSS.
1) Connect ONLY one module to the microcontroller while running the code "ChangeDeviceID.xxx". See the detail information in the Product document.
2) Open the code "ChangeDeviceID.xxx" (Depends on the platform you are using).
Change the definition of the DeviceID and PSS for example C code for Arduino setting the Device ID to '0' and PSS to '15'.(The PSS would always be '15' in the demo code)
///////////////////[ Only this pieces of code need to be changed ]//////////// #define ID (0) /* Please change the ID you need for 4 module please set to 0/1/16/17 for each module*/ ////////////////////////////////////////////////////////////////////////////////////////////////// #define PSS (15) /* RSS = (PSS + 1) * 8 = 128, Real Screen Size = (PSS + 1) * 8 */3) Upload the program to your microcontroller, and wait for about 5 seconds, if the changing DeviceID and PSS successfully, the RGB LED Matrix will turn green.
If after 5 second nothing change to the module, check your power and connections and try it again.
And I recommend to put a label to back side of the module.
4) Set the DeviceIDs of other modules to '1', '16', '17', follow the steps from 1) to 3), and do that again, until you change the DeviceID to '0', '1', '16', '17'.
Comments
1) Connect the modules as it shows(from the back side). Please check the Product document make sure you know how to connect multiple modules.
2) Connect to power supply and your microcontroller.(From the back side)
3) Open the demo code or project, and upload to your microcontroller.
Demo code for Propeller(Spin) ST-00050-Spin-demo-V1.0.zip
Demo code for Propeller(C) ST-00050-C-demo-V1.0.zip
Demo code for Arduino(C) ST-00050-Arduino-code-V1.1.zip
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
PS: I also wrote the classic game Snake which was very popular on cell phone for 9 modules(with 5-position switch control), run on Arduino platform. Just for fun.
The code can run with 4 Modules after a few modifications to the source code.(You need to set the the bounds).
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
The detail information of the snake demo has been moved to this thread.
http://forums.parallax.com/showthread.php?144400-A-simple-game-Snake-run-on-8x8-RGB-LED-Matrix-Module-Ardunio-5-Position-switch
Very impressive. They look like fun modules to play with.
Devilishly clever way to get me to buy 3 more modules! Very nice demo.
If you're up to a bit of soldering, you could make a large display with these $6 arrays and run them off a single Prop.
I'm working on a large display (32x32 pixels) myself and I'll be sharing my code.
I don't have anything against the ST arrays but I sure don't want to buy 16 of them to make my large array.
No offense taken. It could help you in your project to take a look at the schematic of the current ST module and you can do it right now in this post: http://forums.parallax.com/showthread.php?144231-SimplyTronics-8x8-RGB-LED-Matrix&p=1146913&viewfull=1#post1146913
Yes, the Propeller can control more than one 8x8 matrix display at a time but it would be convenient to have them all soldered together in one unit. We actually have an open engineering project in ST for a 16x16 module with a single Propeller, but the project is on-hold for several reasons:
want to make sure that if we make a 16x16 or 32x32 module it would sell enough units to at least recover the time-effort invested in designing it
were paying a lot of attention to feedback on the 8x8 modules before we get too deep in the bigger module design, to make sure we can make improvements based on that feedback
need to finish releasing material developed for the 8x8 modules (I should be able to post our internal, Beta PC software in the forums by the end of this week)
were almost done with a couple of GPS projects that we need to wrap and release soon, before we can get back to LED-land
Some more information that you may find useful in your project:
We looked around trying to find 16x16 or bigger matrix displays, but the standard is 8x8 and any bigger module should just have several 8x8 bricks soldered together.
The manufacturers of these LED matrix displays are very unstable. By the time we finished the design of our 8x8 module the original manufacturer went under and we had to switch to a different manufacturer which required some PCB touch up work for the final production module. While working in the 16x16 project we heard about several LED displays manufacturers closing.
In ST were interested in only using raw parts that will be available for a long time. At least for as long as there is any interest in people buying the product based on those parts. This is why we approach certain suppliers and use parts that are currently in active production.
For anyone interested in making just one custom display itd be OK using surplus parts. There are a lot of leftovers on different batches from the manufacturers that closed in China (we had a collection in our office :-) so you can get them really cheap. But if youre working on a project with the intention to scale-up or mass-produce a display later, Id recommend you to track down a reliable supplier.
Instead I bought 4 more so now I have 5. I got the 4 module demo running after I got the module rotation right <g>. Very cool stuff, thanks ST and Parallax!