Hi,
I am trying to make a some patterns which run on 6 RGB Leds (Common Anode). I uploaded the circuit diagram. I have also written code but it is not a worth it. I need help on creating some patterns like 6 Leds get on with red colour then change into green and finally blue color with some interval.
please guide me, how to make code efficient and optimized.
In diagram 4 transistors are used but now i am using 3 transistors (only 6 Leds)
const int row[4] = {12,8,7}; // Arduino row pins
const int column[6] = {11,10,9,6,5,3}; // Arduino column pins
void setup()
{
for (int i = 0;i<3; i++)
{
pinMode(row[i], OUTPUT);
digitalWrite(row[i],HIGH);
}
for (int j = 0;j<6; j++)
{
pinMode(column[j], OUTPUT);
digitalWrite(column[j], HIGH);
}
}
void loop() {
analogWrite(11,255);
analogWrite(10,0);
analogWrite(9,255);
digitalWrite(12,LOW);
digitalWrite(12,HIGH);
digitalWrite(8,LOW);
digitalWrite(8,HIGH);
digitalWrite(7,LOW);
digitalWrite(7,HIGH);
}
Thanks is advance.
