Go Down

Topic: any tutorials on this? (Read 3671 times) previous topic - next topic

Ruffsta

is there a way to control each led in the matrix individually or a better way to display what we want it to display vs bit patterns?

AWOL

I only said they "might" be better in PROGMEM - I don't know what else you have in mind to do with this device.
If you were going to build some kind of message matrix with multiple devices, it might be better to save RAM for user-specified messages.

However, there is nothing magical about PROGMEM, it is just another memory space on the processor, and there are lots of tutorials and threads on the topic.

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Ruffsta

#17
Jan 25, 2013, 03:15 pm Last Edit: Jan 25, 2013, 03:58 pm by Ruffsta Reason: 1

Never underestimate a 13 year old when it comes to computer technology ...

Did you start wih easier stuff like the LED blinker and reading an analog input? I find it is good to get the basics right and build on that.


yeah, we got tired of making leds blink, so i go on ebay and get random stuff (such as this) and then go from there.. we did a few digit leds, still trying to get the 3 digit and 2 digits to work.. but in time i guess.

we played around with a sensor (4 pin)..

we want to get into multiplexing - building cubes and dancing images.. he wants to build a torrent (or whatever he calls it).. i have a project i am working on with crossroads.

we have a couple of lcd's yet to play with.. but yeah, multiplexing and the such is what we want to accomplish the most,

Ruffsta

#18
Jan 25, 2013, 03:18 pm Last Edit: Jan 25, 2013, 03:23 pm by Ruffsta Reason: 1

I only said they "might" be better in PROGMEM - I don't know what else you have in mind to do with this device.
If you were going to build some kind of message matrix with multiple devices, it might be better to save RAM for user-specified messages.

However, there is nothing magical about PROGMEM, it is just another memory space on the processor, and there are lots of tutorials and threads on the topic.




we just want it to display different things.. .nothing special at this time.. i have more max7219's if ever needed.. i stocked up on those :)

i mean, it's a red dot 8x8 matrix.. nothing we really can use it for or need it for.. was just something to mess and learn with..

Ruffsta

#19
Jan 25, 2013, 03:59 pm Last Edit: Jan 25, 2013, 10:10 pm by Ruffsta Reason: 1
we were inspired such vids:

http://www.youtube.com/watch?v=dVHP7Nhsn4E

http://www.youtube.com/watch?v=mfcpChh9HRk

http://www.youtube.com/watch?v=v56zLOqhjV4
the wiring and soldering doesn't bother me - it's the rest that does..his coding is off tho

http://www.youtube.com/watch?v=IO5Y13S4rsU

http://www.youtube.com/watch?v=Jw3MOZVG60M

http://www.youtube.com/watch?v=GUcX41pokZY

those are crazy! wish we were in that league of arduino! but alas, we are new and dealing with all this simple (yet confusing) stuff for now.

Ruffsta

k, getting back on subject here... is there another way to control each dot individually other than bit patterns?

thanks

Grumpy_Mike

Quote
is there another way to control each dot individually other than bit patterns?

No you have to do it through bit patterns. Why is that a problem?

CrossRoads

There's a MAX7219 on the board, yes?
It has 8 registers you write to, 1 for each column of data, at addresses 0x01 thru 0x08.
You want a single LED on, you write to the register for that column with the data you want.
I use SPI to control MAX7219s vs the shiftout/bit bang discussed so far, hardware transfer vs a software transfer.

an example would be:
Code: [Select]

digitalWrite(SSpin, LOW); // SSpin is generally D10
SPI.transfer(register0);     // declared earlier in code as 'byte register0 = 0x01;
SPI.transfer(data_to_write);  // control in your code = 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 for the 8 LEDs one at a time
digitalWrite(SSpin, HIGH);


if you made an array of the register numbers and the data:
Code: [Select]

byte registerAddress[] = {1,2,3,4,5,6,7,8;};  // registerAddress[0] = 1, [1] = 2, etc. up to [7] = 8
byte data_to_write [8];  // data_to_write [0] = data for  registerAddress[0], ... data_to_write [7] = data for  registerAddress[7]

then you put the above in a loop and just call it when your code changed something:
Code: [Select]

if (dataChanged_flag ==1){   // flag is set when the code makes a change to data_to_write[0] thru data_to_write[7]
dataChanged_flag = 0; // clear the flag
for (x =0; x<8; x=x+1){
digitalWrite(SSpin, LOW); // SSpin is generally D10
SPI.transfer(registerAddress[x]);  // send Register address 1 to 8
SPI.transfer(data_to_write[x]);  // send data for associated register
digitalWrite(SSpin, HIGH);
}

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Grumpy_Mike

If you have a problem seeing how numbers, bit patterns and the display all tie up together, read this:-
http://www.thebox.myzen.co.uk/Workshop/LED_Matrix.html

marco_c

I have the same unit you got and also wired up a marix from individual LEDs (which made me appreciate the made up matrix even more!). Not sure if it will help you or not, but ...

When I was trying to understand what/how the MAX72XX chips do their stuff I wrote a library and a bunch of test code that did 'funky' (ie, useless but interesting at the time) things on the matrix, including addressing individual points on it..

If you are interested in the code for my library and the test/example can be found at the location in my signature block.
Arduino libraries http://arduinocode.codeplex.com
Parola for Arduino http://parola.codeplex.com

Ruffsta


Quote
is there another way to control each dot individually other than bit patterns?

No you have to do it through bit patterns. Why is that a problem?



yes, i don't get it..

like:
Code: [Select]
unsigned char disp1[38][8]={
{0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x3C},//0


0x3C what does the "C" stand for?

why are there multiples of 0x42?

64 dots.. only putting in 8 bits of info?

i'll look at the link you provided shortly.. and ty crossroads - i'll get to that shortly too..

wildbill

Quote
0x3C what does the "C" stand for?

That's hexadecimal notation (q.v.)

Each one of those is eight bits and there are eight of them in your array. That gives you individual control of sixty four bits. There are multiple 0x42s because the pattern being drawn has rows that are the same.

Try making the first byte 0x01 (or indeed 1) and all the others 0. Hopefully a single LED will be lit. replace the 1 with 2, then 4 then 8, then 7. See what is happening?

AWOL

Quote
0x3C what does the "C" stand for?

C is the hexadecimal value of the decimal value 12.
In hex (base 16), digits go 0123456789ABCDEF (16 of them)

Quote
why are there multiples of 0x42?

Because the bit pattern 01000010 repeats vertically.

Quote
64 dots.. only putting in 8 bits of info?

Don't understand the question.
64 bits is eight bytes
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

CrossRoads

Think of your matrix like this:
10101010
10101010
10101010
10101010
10101010
10101010
10101010
10101010

So you have 8 columns, and 8 rows.
In this example, Columns 0,2,4,6 are all 1's. Those represent "on" LEDs. The columns with 0's are 'off' LEDs.
Each column is controlled by 1 register, 1-2-3-4-5-6-7-8.
The top LED  in each column is bit 7 of a register, the bottom LED is bit 0.

If you wanted the lower left LED to be on, you would send B00000001 to register 1.  In HEX, that would be 0x01.
If you wanted every other LED on starting from the bottom, you would send B01010101, or HEX 0x55.
If you wanted 2 of the LEDs on, say at B01000010, you could send 0x42.

So for your example: 0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x3C, with each byte arranged vertically:
0x3C = 0011 1100
0x42 = 0100 0010


00000000
01111110
10000001
10000001
10000001
10000001
01111110
00000000

So that would make a 0, or a square, however you want to reference it.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Nick Gammon


been looking for tutorials on this - (i just finished soldering it altogether and i want to use it),but none really to be found..


http://gammon.com.au/forum/?id=11516
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Go Up