Advanced I/O shifting bits I wanted to tinker around more with the 8-bit shift register (74HC595) so I tried to make a simple LED display and after reading about some shift commands I got lost and didn't understand much...

Let's start simple...

from what I read -- you can send out Binary data 1s and 0s --- does the shift regsiter read it as on and off? the shift register I'm using which is probably the same thing with others but it has 8 pins that can be used as output --- how does it output the data? --- does it output (example) 10100110 which shifts to the right as if 00000000 -&gt; 10000000 -&gt; 11000000 -&gt; 01100000 -&gt; 00110000 -&gt; 10011000 -&gt; 0100110 -&gt; 10100110 through the pins one by one? like pin 1 would get 0 first then 0 will move to pin 2 and pin 1 will get a 1? (still using 10100110 by example above ^ )

Also what would the code look like? how does shiftOut() and shiftIn() work exactly? does all of this have something to do with pulseIn()? what do the bitwise operators like &gt;&gt; and &lt;&lt; or ~ to name a few exactly do?

let's say I made 8 leds hooked up to one of each output pin of the shift-register --- how do I give data to the register? what commands should I use to give data? --- from what I understood I can output 01011011 right? if so, how does the shift-register output it? and if (Assumingly) it does output it like on and off would it eventually turn out as if LED1 = OFF LED2 = ON LED3 = OFF LED4 = ON LED5 = ON LED6 = OFF LED7 = ON LED8 = ON as if I entered in 01011011?

tl;dr

how do 8-bit shift registers work and how do you make codes work with them xP
For the 74HC595 in combination with the Arduino, the best way to check is to use the default example by Arduino:

ShiftOut

With the ShiftOut you can shift the bits into the IC which will make the correct LEDs light up (or not).

Probably you can lit up a LED when passing a HIGH, but you will know very easily by trying the example and check some values/for loops to make them dynamically lighting.

Probably after playing with the example, it will give you much more insight than describing the details here.

Update:


Try first with 00000000 and 11111111 and 8 leds, so you know if 0 will be OFF and 1 will be ON.
Than try with eg 10101010 and 8 leds ... than you know if the first or the last will be on or off.
pulseIn is unrelated
The operators >> and &lt;&lt; are so called bit shift operators. Like 1 &lt;&lt; 3 gives 8, the binary value 0000001 is shifted 3 bits left resulting in 00001000 which has value 8.
~ is the not operator -> which reverses bits.
The shiftOut function can be used to send data to the 74HC595N.
And to be honest, how does it work ... does it really matter for now? First see what the result is, how to use it. Later you can get into details. Start simple first.