Pages: 1 [2] 3   Go Down
Author Topic: any tutorials on this?  (Read 3119 times)
0 Members and 1 Guest are viewing this topic.
Rhode Island - USA
Offline Offline
Full Member
***
Karma: 0
Posts: 156
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 309
Posts: 26488
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

"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.

Rhode Island - USA
Offline Offline
Full Member
***
Karma: 0
Posts: 156
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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,
« Last Edit: January 25, 2013, 09:58:58 am by Ruffsta » Logged

Rhode Island - USA
Offline Offline
Full Member
***
Karma: 0
Posts: 156
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley

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..
« Last Edit: January 25, 2013, 09:23:47 am by Ruffsta » Logged

Rhode Island - USA
Offline Offline
Full Member
***
Karma: 0
Posts: 156
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

we were inspired such vids:






the wiring and soldering doesn't bother me - it's the rest that does..his coding is off tho







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.
« Last Edit: January 25, 2013, 04:10:00 pm by Ruffsta » Logged

Rhode Island - USA
Offline Offline
Full Member
***
Karma: 0
Posts: 156
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

thanks
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 634
Posts: 34527
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27353
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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:
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:
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);
}
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 634
Posts: 34527
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1284
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

 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.
Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

Rhode Island - USA
Offline Offline
Full Member
***
Karma: 0
Posts: 156
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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..
Logged

New Jersey
Offline Offline
Faraday Member
**
Karma: 70
Posts: 3727
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 309
Posts: 26488
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

"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.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27353
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 497
Posts: 19055
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged


Pages: 1 [2] 3   Go Up
Jump to: