Go Down

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

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. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

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

Go Up