How do i do this easly do this?

I want to take eleven '11-bit' binany #'s,(example of 1st 11bit '#' --> 1,10101,10101) then send the current '11-bit' # (let's say [u]the 1st #[/u]) through the usb connetion, to an Arduino, using the "Serial.read()" command, then use the Arduino to convert that '11-bit' # to an "8-bit" decmal #, then take the remainning "3-bit #" of [u]the 1st '11-bit' #[/u] and move those 3-bits to be the 1st 3-bits of the next "8-bit decmal #" and so on....

this might help u visualize it...

this0ne by TECH-GEEK, on Flickr

Well, you can't send an 11-bit number through the USB connection. You can send as many 8-bit numbers as you like so you can break the 11 bit numbers into 8-bit chunks BEFORE you send them or you can send each bit as an 8-bit character (like '0' or '1') and convert the characters back into bits at the Arduino end. Which do you want to do?

i need it to be sent like the following so it is easy for me to think up...

11010101011 //press send 11010101011 //press send 11010101011 //press send 11010101011 //press send 11010101011 //press send 11010101011 //press send 11010101011 //press send 11010101011 //press send 11010101011 //press send 11010101011 //press send 11010101011 //press send 'spacebar' //press send //'spacebar' is ignored in code(for my refrence)

the end result needs to be in form of 8-bit decmal format each 8-bit # is then sent to a shift-register which control an 11*11 grid of leds so basicly the binary #'s represent wether each led is on or not... also this is still in prototype-stage so thing may change...

in addition i'm not actally sending it through usb... but read from an microSD card, connected to a Mega-compattible/Arduino Name Brand ethernet shield with pin 10 on the shield disconnected to the mega's pin 10 and re-wired to pin 53 on my mega

Do this - send it as 2 8-bit bytes for loading into 2 bit shift registers (the SD card stores 8-bit bytes also), 5 of the bits will just not be used. Then you can use standard shiftout command, and not have to write your own 11-bit shiftout code.

i NEED it to be sent the way i described in the last post if it is sent a differant way it will make creating the patterns on the 11*11*11 led cube extremly hard also i'm tight on cash so i have to work with as few shift registers as possible

11 or 16 bits you still need two shift regs. I don't understand why you can't work with 16-bit values as CR said and just ignore the upper 5 bits.


Rob

i want it to be as i discribed mainly because i do not know how to code it any other way.( i need to learn more) if someone could either give me an example code or an explainaition i would be fine...

So as I see it you are getting data in chunks of 11 11-bit values from an SD and you want to pump them out to shift regs.

One thing at a time, how is the data stored on the SD? You can't store 11-bit values so it is either stored as 11 bytes or as bits in two bytes.


Rob

Check out these shift registers, 74AC299PC, 56 cents at Newark.
Good for sinking/sourcing 24mA.
http://www.datasheetcatalog.org/datasheet/fairchild/74AC299.pdf

Assuming common cathode connections:
Each layer needs 11 bits of anode drive, and 11 bits of common cathode sink.
So thats 121 bits of each total, requiring 16 shift registers of anode drivers and 16 registers with high current sink drivers, such as ULN2803 buffering the output of 74HC595 (or 121 discrete transistors).

So you plan to shift out 16 bytes of anode information, and then shift a low across the first 11 cathode drivers, shift out 121 bits of anode and a low thru the next 11, and so on?
I guess that could work.

i think it is in .txt format here is an an example:

10001010001
01000100010
00100000100
00010001000
10001010001
01000100010
10001010001
00010001000
00100000100
01000100010
10001010001

10001010001
01000100010
00100000100
00010001000
10001010001
01000100010
10001010001
00010001000
00100000100
01000100010
10001010001

CrossRoads: Check out these shift registers, 74AC299PC, 56 cents at Newark. Good for sinking/sourcing 24mA. http://www.datasheetcatalog.org/datasheet/fairchild/74AC299.pdf

it is not just a mater of cost but also shipping time... i leave for a colloge evaluation in less than 2 weeks at which time i need to have finnished the entire cube project... i have yet to finish soldering the 2nd layer of the 11 total and before i do any more solding i need to have a funtioning code and a finishedn version of a currently un-finihed costum shift-registor shield

Here’s a code snippet to get the characters and combine them into an int

	int val = 0;
    char c;
  	for (int i = 0; i < 11; i++) {
		c = get_char_from_SD();  // you figure out how to do this
		val <<= 1;
		val |= int(c - '0');
	}

This takes data in 11-byte chunks and accumulates the ASCII '1’s and '0’s into a binary integer.

Then you shift that int out as two bytes

shiftOut(dataPin, clockPin, bitOrder, val & 0xff); // low 8 bits
shiftOut(dataPin, clockPin, bitOrder, val >> 8); // high 5 bits + 3 you don't care about

Rob