const int pwm[]={3,5,6,9};
int i,j;
const int brightness[][4] = {{255,0,0,0},
{100,255,0,0},
{50,100,255,0},
{5,50,100,255},
{0,5,50,100,},
{0,0,5,50},
{0,0,0,5},
{0,0,0,0},
{0,0,0,255},
{0,0,255,100},
{0,255,100,50,},
{255,100,50,5},
{100,50,5,0},
{50,5,0,0},
{5,0,0,0},
{0,0,0,0}
};
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
for(i=0;i<16;i++) {
for (j=0;j<4;j++)
analogWrite(pwm[j],brightness[i][j]);
delay(500);
}
}