This is my code, I'm trying to use 2 ShifRegisters Independently... but when I load and run the program on the Arduino ONE something fails, I checked the connections and they are ok... I just want to know if its possible to use 2 ShifRegisters controlled independently like this? Please Comment?
int latchPin1 = 2;
int clockPin1 = 3;
int dataPin1 = 4;
int latchPin2 = 5;
int clockPin2 = 6;
int dataPin2 = 7;
int array1[8] = {1,2,4,8,16,32,64,128};
int array2[8] = {128,64,32,16,8,4,2,1};
void setup()
{
pinMode(latchPin1, OUTPUT);
pinMode(clockPin1, OUTPUT);
pinMode(dataPin1, OUTPUT);
pinMode(latchPin2, OUTPUT);
pinMode(clockPin2, OUTPUT);
pinMode(dataPin2, OUTPUT);
}
void loop()
{
for(int i = 0; i < 8; i++)
{
digitalWrite(latchPin1, LOW);
digitalWrite(latchPin2, LOW);
shiftOut(dataPin1, clockPin1, MSBFIRST, array1*);*
_ shiftOut(dataPin2, clockPin2, MSBFIRST, array2*);*_
* digitalWrite(latchPin1, HIGH);*
* digitalWrite(latchPin2, HIGH);*
* delay(100);*
* }*
}
sketch_jun30a.ino (387 Bytes)