I am following the shiftout tutorial on the site and have completed the counting upto 256 using one 595 shift register. I have added the second 595 and connected a further 8 Led's. This counts up on the Red Led's and down on the Green Led's still using 256, what I want to do is count up using all the Led's. So thats Bin 1111111111111111 = 65535. How would I change the code to achieve this?

//for each bit in the byte myDataOut? //NOTICE THAT WE ARE COUNTING DOWN in our for loop //This means that %00000001 or "1" will go through such //that it will be pin Q0 that lights. for (i=7; i>=0; i--) { digitalWrite(myClockPin, 0);

//if the value passed to myDataOut and a bitmask result // true then... so if we are at i=6 and our value is // %11010100 it would the code compares it to %01000000 // and proceeds to set pinState to 1. if ( myDataOut & (1<<i) ) { pinState= 1; } else { pinState= 0; }

//Sets the pin to HIGH or LOW depending on pinState digitalWrite(myDataPin, pinState); //register shifts bits on upstroke of clock pin digitalWrite(myClockPin, 1); //zero the data pin after shift to prevent bleed through digitalWrite(myDataPin, 0); }

thanks that seemed to work. i was surprised to see the second 595 counts first. so i swapped the LED inputs about. So the second 595 has the first LED's attached and the first 595 has the second LED's. I have the serial monitor printing and it counts up fine.

Just out of interest since I have this setup how would I specify a single number to display like "43690" which would hopefully display 1010101010101010 (On, off, On off etc)?