unsigned char r,b,g, x; void setup() { // put your setup code here, to run once: r=255; g=255; b=0; DDRC=0x07; } void loop() { // put your main code here, to run repeatedly: while (1) { x++; if (x==0) { if (r !=0) PORTC |= 1; if (g !=0) PORTC |= 4; if (b !=0) PORTC |= 2; } if (r==x) PORTC &= 0x06; if (g==x) PORTC &= 0x03; if (b==x) PORTC &= 0x05; // r++; // g++; // b++; } }