# Shift out 64 bit [Led globe]

Hi, I am a beginner and I ask you for help. For the final work I want to do Led Globe with 64 LEd's , I use a 74HC595 and don't know how to shift out 64 bits I was wondering if it is possible 64 digit binary number converted to decimal and shift it out. Or someone has someone better solution?

Hi,

Where / how are the 64 digits stored?

Are them digits or bits?

Regards

I drew a map ( 64 * 90 ) pixels, LED 's will be connected to 74HC595 and dont know how to make a program. I thought about that 64 LEDs turn into a decimal , and so I put in the program . I see no other solution , do you have any ?

Hi,

Don't get nervous: have you a 64 x 90 = 5.760 leds to turn on off indepently?

Regards

haha no no, i'm making something like this Persistance of vision Globe with propeller clock - YouTube
So i have 64 leds

I don't understand the desire to convert them to decimal. Decimal is something for humans to read, computers do everything in binary and that's how everything is stored on the processor.

Show us the code you have so we can see how your bytes are assembled. Generally, you would shift out 1 byte at a time. For 64 bits, you'd shift out 8 bytes.

Luka1616:
I use a 74HC595

I certainly hope you have more than 1.

The lesser problem you have is to shift 96 bits (if your project is like this)

I have not started the program , I looked at many sites , but I have not found something that would help me . I need to shift out 90 * 8 byte , and I think it would be very slow
Yes, I use them 8

Luka1616:
I have not started the program , I looked at many sites , but I have not found something that would help me . I need to shift out 90 * 8 byte , and I think it would be very slow
Yes, I use them 8

What is your definition of slow. That should happen in less than a millisecond I think.

64 LEDs, just use a MAX7219 to control them.
I even have a little breakout board so you connect each one up individually. Then itâ€™s just a simple matter to send out 8 bytes when the globe needs updating, each byte holding the state of 8 LEDs as discussed above:

``````for (x=0; x<8; x=x+1){
digitalWrite(ssPin, LOW);
SPI.transfer (x+1); // register addresses, 1 to 8
SPI.transfer (dataArrray[x]); // data
digitalWrite(ssPin, HIGH);
}
``````

If youâ€™ll start writing some code, the answer may smack you in the face it is so obvious. If not we can surely help. But here is one example of shifting out 8 bytes. You simply send them out one after the other.

``````byte myData = {0x54, 0x22, 0x34, 0x45, 0x56, 0x67, 0x12, 0x10}; Â // Some random bytes

for(int i = 0; i < 9; i++){
Â  Â  shiftOut(dataPin, clockPin, MSBFIRST, myData[i]);
}
``````

Delta_G:
What is your definition of slow. That should happen in less than a millisecond I think.

as I said , I'm a beginner , so I do not know how fast it was . The rotation speed of the globe will be 900rpm , at every turn is to be displayed 90 columns , each column has 64 bit

Delta_G:
If youâ€™ll start writing some code, the answer may smack you in the face it is so obvious. If not we can surely help. But here is one example of shifting out 8 bytes. You simply send them out one after the other.

``````byte myData = {0x54, 0x22, 0x34, 0x45, 0x56, 0x67, 0x12, 0x10};Â  // Some random bytes
``````

for(int i = 0; i < 9; i++){
Â  Â  shiftOut(dataPin, clockPin, MSBFIRST, myData[i]);
}

0x54 is really a decimal number 54 to the program viewed as binary 110110 ? for(int i = 0; i < 9; i++) This sends one after the other ? 0x54 first , then 0x22 â€¦ ?

Luka1616:
0x54 is really a decimal number 54 to the program viewed as binary 110110 ? for(int i = 0; i < 9; i++) This sends one after the other ? 0x54 first , then 0x22 â€¦ ?

No, 0x54 is written in hexadecimal. In decimal it would be 84. But to the computer it is ALL binary. You have to get out of your head any difference between hex numbers, binary numbers, and decimal numbers aside from how YOU write them. You can write them however you want in your program, they are all binary to the computer.

Yes, the for loop sends those bytes one right after the other. If you have the shift registers daisy chained then that is what you will have to do. Send them one at a time.

Oh, thanks, so I need to convert my bit into hexa and write it like that

than i need to write these 90 times, 1 for every column, insert a delay and itâ€™s it?
"byte myData = {0x54, 0x22, 0x34, 0x45, 0x56, 0x67, 0x12, 0x10}; // Some random bytes

for(int i = 0; i < 9; i++){
shiftOut(dataPin, clockPin, MSBFIRST, myData*);*
}"

Luka1616:
Oh, thanks, so I need to convert my bit into hexa and write it like that

No your bytes are fine as they are. You're not listening. I just wrote them in hex in that example. The compiler doesn't care how you wrote them, hex, decimal, octal, or what. They will ALL BE BINARY when the computer works with them.

So, my first column is 10000000 00000000 00000000 00000000 00000000 00000000 00000000 00111000

will this work ?
byte myData = {10000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00111000};

for(int i = 0; i < 9; i++){
shiftOut(dataPin, clockPin, MSBFIRST, myData);
}
I know itâ€™s all processed as a binary notation , I just thought it would be nicer to write the second record ( lower digits )

Luka1616:
byte myData = {10000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00111000};

You're getting closer. You've written some large decimal constants. If you mean for the compiler to know that you were writing in binary you need the 0b.

``````byte myData = {0b10000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00111000};
``````
``````for(int i = 0; i < 9; i++){
Â  Â shiftOut(dataPin, clockPin, MSBFIRST, myData[i]);
``````

Youâ€™re missing the [ i ] to get the array data.
That it is going to be sooo slow.
And will also send out 9 bytes. You only need myData[0] to mydata[7],
so use i<8.
And youâ€™re missing the binary data indication, 0b:

``````byte myData = {0b10000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00111000};
``````

Ooops. I think the 9 thing was my fault.