So I admit I am a little nervous about coding an arduino to any extent. I was hoping the experts could look at the code and see if there is something I am missing? This is my first attempt to light up these two 8x8 grids, and I want to make sure I am not going to break any hardware with the code. I do not have my hardware as of yet, I thought I would attempt to get a jump on the code.
#include "binary.h" //Use this include for writing a byte in binary
#include "LedControl.h"//Use this include for controling LED's
LedControl lc=LedControl(12,11,10,2); /// Arduino data pin,clock pin,device selecting pin, number of max7219's
void setup() {
lc.shutdown(0,false); // Turn off shutdown
lc.setIntensity(0,5); // Set the intensity ... first device to 5
lc.setIntensity(1,5); // Set the brightness ... second device 5
}
void loop() {
lc.setRow(0,0,B10110101); // First row of LED's...first max7219
lc.setRow(1,0,B10101000); // First row of LED's...second max7219
lc.setRow(0,1,B11010101); // Second row of LED's...first max7219
lc.setRow(1,1,B10101000); // Second row of LED's...second max7219
lc.setRow(0,2,B10101101); // Third row of LED's...first max7219
lc.setRow(1,2,B01011000); // Third row of LED's...second max7219
lc.setRow(0,3,B10101101); // Fourth row of LED's...first max7219
lc.setRow(1,3,B01101000); // Fourth row of LED's...second max7219
lc.setRow(0,4,B10110101); // Fifth row of LED's...first max7219
lc.setRow(1,4,B01101000); // Fifth row of LED's...second max7219
lc.setRow(0,5,B10110101); // Sixth row of LED's...first max7219
lc.setRow(1,5,B10101000); // Sixth row of LED's...second max7219
}
Well I am glad I won't break anything with the code. Thanks again for the link,,, I actually ordered two of that very same starter kit. The info on the link is priceless, it will make connecting hardware so much easier. I am going to code four of those "binary groups" with different patterns of course, 12 different ways, giving me a total of 28 different patterns. I hope the arduino has enough memory.
Thank you very much once again.
On that page was a 8x8 bit font, so yes you should be able to store 28 patterns. Use PROGMEM like I did to save copying those into RAM, which you have less of.
Well I got the code built anyways..and size was 13010, all I gotta do now is attach a piece of code for a 7 segment display... then I am good... As far as PROGMEM that looks confusing, I will have to research that.. but it kind of reminds me of address programming when I was in electronics school,, way back...
I am still waiting for my hardware too.... I will keep updating when it comes in.
Vaclav, Hexidecimal is,,, well a good challenge... LOL When I am more efficient at coding maybe I will give it a try.
Hardware came in today,,, merry christmas to me ;)... so build test, then attempt PROGMEM..which still looks confusing. The led grids were much smaller then I expected, though Gammon is correct again, they do not sit on a bread board... i can make it work with two breadboards, for testing. I will keep everyone posted.