const int STcp = 27;//ST_CP
const int SHcp = 26;//SH_CP
const int DS = 25; //DS
const int STcp2 = 18;//ST_CP
const int SHcp2 = 17;//SH_CP
const int DS2 = 16; //DS
int datArray[] = {B00000000, B00000001, B00000011, B00000111, B00001111, B00011111, B00111111, B01111111, B11111111};
int datArray2[] = {B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000};
void setup ()
{
//set pins to output
pinMode(STcp,OUTPUT);
pinMode(SHcp,OUTPUT);
pinMode(DS,OUTPUT);
pinMode(STcp2,OUTPUT);
pinMode(SHcp2,OUTPUT);
pinMode(DS2,OUTPUT);
}
void loop()
{
//delay(1000);
leftTurn();
//leftTurn();
//leftTurn();
//leftTurn();
//delay(5000);
//rightTurn();
delay(400);
for (int num = 0; num < 9; num++)
{
digitalWrite(STcp, LOW); //ground ST_CP and hold low for as long as you are transmitting
shiftOut(DS, SHcp, MSBFIRST, datArray2[num]);
digitalWrite(STcp, HIGH); //pull the ST_CPST_CP to save the data
delay(100);
}
}
// Left Turn Signal
void leftTurn() {
for(int num = 0; num <9; num++)
{
digitalWrite(STcp,LOW); //ground ST_CP and hold low for as long as you are transmitting
shiftOut(DS,SHcp,MSBFIRST,datArray[num]);
digitalWrite(STcp,HIGH); //pull the ST_CPST_CP to save the data
delay(100);
}
}
// Right Turn Signal
void rightTurn() {
for(int num = 0; num <9; num++)
{
digitalWrite(STcp2,LOW); //ground ST_CP and hold low for as long as you are transmitting
shiftOut(DS2,SHcp2,MSBFIRST,datArray[num]);
digitalWrite(STcp2,HIGH); //pull the ST_CPST_CP to save the data
delay(100);
}
}