thank you mr crossroads,
i will try it soon, but i want to ask about blink some led on some pin of the shiftregister
eg pin 2 i use this code and led not blink it's on all the time
//Pin connected to ST_CP of 74HC595
int latchPin = 8;
//Pin connected to SH_CP of 74HC595
int clockPin = 12;
////Pin connected to DS of 74HC595
int dataPin = 11;
void setup() {
//set pins to output so you can control the shift register
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
}
void loop() {
byte outVal = 0; // Define output data
bitSet(outVal, 2); // Set bit 2
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, outVal);
digitalWrite(latchPin, HIGH);
// pause
delay(1000);
// }
}
what is the problems in my code or if there are simple way to high a pin without this
byte outVal = 0; // Define output data
bitSet(outVal, 2); // Set bit 2
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, outVal);
digitalWrite(latchPin, HIGH);
i will use the shiftregsiters to control a 16 rely
on the scend one of the shift register
when i want to high one pin like 1 or two
the code will
byte outVal = 0; // Define output data
for the pin two one the scend register it's will 8+ 2 ?
bitSet(outVal, 10); // Set bit 2
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, outVal);
digitalWrite(latchPin, HIGH);
thank you so much