Dear all, first 'ible from me, so be gentle.
As I have been playing around with Arduinos for a few months, I find that knowing what to do with them is the main problem. I have lots of bits and pieces, and have found the instructibles on here very useful. I have looked at a few sketches here and online then modified them to do different things, as I find the best way is to look at something, and see how someone has done it and then use that to do what I want to do.
I feel I should give back to the Arduino community, and hope that some of these sketches are useful to others. Some of the sketches have been made by my students.
As I have looked at so many sketches, I have lost track now of which ones I used as a base, and am happy to acknowledge those that I have modified, so apologies if some people are not acknowledged for their sketches.
This one was the most comprehensive LED Matrix with Arduino as it has so much in it. It also includes a library that is very useful, and provides four example sketches. If anyone recognises the original sketches, please let me know so I can give credit where it is due.
Step 1: What I Hope to Do Here
So - this little device is amazing and a great start for any Arduino fan. I suggest you get the second part (MAX7219) to plug the LED matrix into as it simplifies the wiring enormously, it is a much neater and simpler solution.
I will show you a few sketches, with scrolling text, basic animations and finally a Pong game (not player interactive however - there are some ibles that do this, but I am keeping this very simple), but the sketches may be useful to someone out there. I hope that when you get the sketch loaded, you will then be able to look at the sketch and see what makes it work. i know there are multiple LED ibles out there - but in this one I hope to bring together several sketches, that will only use the LED, and some cables (plus an Arduino), only the PIN numbers will need changing which is no big deal.
Step 2: Materials
8x8LED matrix, with a MAX7219 - I will be referencing the one in the picture with 5 male pins, and will not be looking at wiring up just the matrix on a breadboard - others have ibles on that. The MAX7219 is what you want IMHO if you don't fancy soldering, (personally I hate it).
Arduino Uno (should work with others too, I guess)
Five female-male cables, or in my case, female-female then five male-male cables to connect to the Arduino
5V power supply - either computer or battery source. I find the chargers for phones very handy - I have a small one that I use for all my Arduino stuff, as it is really too small for recharging phones - 2200mAh, but I find is ideal for Arduino powering.
Step 3: Wiring the LED
Wire up the 8x8 matrix with your cables - colours are irrelevant, but if you match them up (I rarely do) it makes your wiring easier. So the female ends go on the LED, then wire in the male-male cables (in my case).
Step 4: Add the Male Cables
Connect the male cables to the female endings, try to use the same colours if you can, it is useful, but not essential.
Step 5: Connect to Arduino (cables)
Wire up the Arduino -
Now you need to load the sketch you want to load, and check on the pins needed there, then follow this from the matrix and wire them in as the sketch says. [I have edited all sketches so they are the same pins each time].
pin 12 is connected to the DataIn
pin 11 is connected to the CLK
pin 10 is connected to CS (LOAD)
If you do not wire them properly, it will not work as the Arduino will be sending information out on a certain pin, and that will not be received, if it is not going to the correct pin on the LED. Each sketch is the same pin references, so you can flip from one to the other without having to rewire each time.
Step 6: Upload the Sketch
Connect the Arduino to the computer and load a sketch from below. Make sure the pins referred to in the sketch, are the way you have wired them on the Arduino.
One or two of the sketches need a file to be included in the library - LEDControlMS.h - I will mark those with **
This can be found on this ible LEDControlMS
- on a Mac, you need to put the folder into Users>xyz (name of your login)>Documents>Arduino>libraries
- on a PC put the folder in Documents>Arduino>libraries
Sketches to try out:
Flashing broken heart
Flashing smiley face
Animation countdown **
TFBoy scrolling text **
Pong animation 2 **
Feel free to play around with them and change the text, animations etc. Enjoy.
Step 7: Be Amazed, and Play With the Sketches
Run the sketches, and be amazed and then edit them.
Look at some of the numbers in the sketch, eg AnimDelay, Intensitymin, etc - and try editing them to see what happens. For example, you can mend my Achey Breaky Heart, for a start :)
Step 8: Top Tip for You
If you are trying to draw something on the LED, eg a smiley face, or a house, I find it is most useful to do it first in Excel, using a box 8 by 8 which represents the lights on the LED and then that is much easier to transfer the numbers afterwards, as it is more visual for me.