Graynomad:
You simply shift 16 bits out by calling shiftOut() twice. EGint pin_bits0 = 0x0F; // example, sets lower 4 bits
int pin_bits1 = 0x80; // and the upper bit
shiftOut(dataPin, clockPin, MSBFIRST, pin_bits1); // send upper 8 bits
shiftOut(dataPin, clockPin, MSBFIRST, pin_bits0); // send lower 8 bits
The variables pin_bits0 and 1 remember the current state of the outputs.
I can't believe that it is so easy to do $)
In fact as i didn't know about shiftOut() function, i did not thought it was generating the clock signal by its own !
This is great news !
But now, i have some more questions ... XD
- Time = 0 >>> I want to turn ON relay 3
- Time = 1 >>> I want to keep relay 3 ON and turn ON relay 7
- Time = 2 >>> Now i want to turn OFF relay 3
While being at Time = 1, does the shifting-register keeps in mind the state of the relay 3 ?
If it keeps it in mind, will there be some kind of short cut OFF/ON while turning on the relay 7 ?
Thanks for your precious help !
PS : i found this thread which the last post describes that he could drive 40 relays with a CD4094 (and with a 74HC595). http://forums.adafruit.com/viewtopic.php?f=25&t=7239&start=0
So i now feel it is the good way