Готовый скейч для ArduinoMEGA 30 каналов (10 зон)
Выводы arduino с 22 по 51.
	PHP код:
	
#define D22_High PORTA |=B00000001 //red line-1 on 
#define D22_LOW PORTA &= B11111110 //red line-1 off 
#define D23_High PORTA |=B00000010 //green line-1 on 
#define D23_LOW PORTA &= B11111101 //green line-1 off 
#define D24_High PORTA |=B00000100 //blue line-1 on 
#define D24_LOW PORTA &= B11111011 //blue line-1 off 
#define D25_High PORTA |=B00001000 //red line-2 on 
#define D25_LOW PORTA &= B11110111 //red line-2 off 
#define D26_High PORTA |=B00010000 //green line-2 on 
#define D26_LOW PORTA &= B11101111 //green line-2 off 
#define D27_High PORTA |=B00100000 //blue line-2 on 
#define D27_LOW PORTA &= B11011111 //blue line-2 off 
#define D28_High PORTA |=B01000000 //red line-3 on 
#define D28_LOW PORTA &= B10111111 //red line-3 off 
#define D29_High PORTA |=B10000000 //green line-3 on 
#define D29_LOW PORTA &= B01111111 //green line-3 off 
#define D30_High PORTC |=B10000000 //blue line-3 on 
#define D30_LOW PORTC &= B01111111 //blue line-3 off 
#define D31_High PORTC |=B01000000 //red line-4 on 
#define D31_LOW PORTC &= B10111111 //red line-4 off 
#define D32_High PORTC |=B00100000 //green line-4 on 
#define D32_LOW PORTC &= B11011111 //green line-4 off 
#define D33_High PORTC |=B00010000 //blue line-4 on 
#define D33_LOW PORTC &= B11101111 //blue line-4 off 
#define D34_High PORTC |=B00001000 //red line-4 on 
#define D34_LOW PORTC &= B11110111 //red line-4 off 
#define D35_High PORTC |=B00000100 //green line-4 on 
#define D35_LOW PORTC &= B11111011 //green line-4 off 
#define D36_High PORTC |=B00000010 //blue line-4 on 
#define D36_LOW PORTC &= B11111101 //blue line-4 off 
#define D37_High PORTC |=B00000001 //red line-4 on 
#define D37_LOW PORTC &= B11111110 //red line-4 off 
#define D38_High PORTD |=B10000000 //green line-4 on 
#define D38_LOW PORTD &= B01111111 //green line-4 off 
#define D39_High PORTG |=B00000100 //blue line-4 on 
#define D39_LOW PORTG &= B11111011 //blue line-4 off 
#define D40_High PORTG |=B00000010 //red line-4 on 
#define D40_LOW PORTG &= B11111101 //red line-4 off 
#define D41_High PORTG |=B00000001 //green line-4 on 
#define D41_LOW PORTG &= B11111110 //green line-4 off 
#define D42_High PORTL |=B10000000 //blue line-4 on 
#define D42_LOW PORTL &= B01111111 //blue line-4 off 
#define D43_High PORTL |=B01000000 //red line-4 on 
#define D43_LOW PORTL &= B10111111 //red line-4 off 
#define D44_High PORTL |=B00100000 //green line-4 on 
#define D44_LOW PORTL &= B11011111 //green line-4 off 
#define D45_High PORTL |=B00010000 //blue line-4 on 
#define D45_LOW PORTL &= B11101111 //blue line-4 off 
#define D46_High PORTL |=B00001000 //red line-4 on 
#define D46_LOW PORTL &= B11110111 //red line-4 off 
#define D47_High PORTL |=B00000100 //green line-4 on 
#define D47_LOW PORTL &= B11111011 //green line-4 off 
#define D48_High PORTL |=B00000010 //blue line-4 on 
#define D48_LOW PORTL &= B11111101 //blue line-4 off 
#define D49_High PORTL |=B00000001 //red line-4 on 
#define D49_LOW PORTL &= B11111110 //red line-4 off 
#define D50_High PORTB |=B00001000 //green line-4 on 
#define D50_LOW PORTB &= B11110111 //green line-4 off 
#define D51_High PORTB |=B00000100 //blue line-4 on 
#define D51_LOW PORTB &= B11111011 //blue line-4 off 
volatile unsigned int tcnt2; 
volatile byte pwm_time; 
//byte pwm_time, Red_R_Old, Green_L_Old, Blue_T_Old; 
unsigned long blank=0; //таймер простоя 
byte volatile color[30]; //массив храннения цветов 12-ть каналов 
void setup() 
{ 
for (int i=2; i < 52; i++){pinMode(i, OUTPUT);} 
Serial.begin(115200); 
TIMSK2 &= ~(1<<TOIE2); //разрешения прерывания по переполнению таймера/счетчика Т2 
TCCR2A &= ~((1<<WGM21) | (1<<WGM20));// Режим работы таймера/счетчика 
TCCR2B &= ~(1<<WGM22);// Режим работы таймера/счетчика 
ASSR &= ~(1<<AS2); //Выбор источника синхронизации таймера если AS2=0 от системного генератора 
tcnt2 = 250; // 16000000/31000/64=8 tcnt2=256-8=248. 
TIMSK2 |= (1<<TOIE2);//Разрешение прерывания по переполнению Т2. 
} 
void loop() 
{ 
if (Serial.available() > 30) 
{ 
if (Serial.read() == 255) //проверка прификса 
{ 
for (int i = 0; i < 30; i++) 
{ 
color[i] = Serial.read(); // прочитать данные о цветах из порта в массив 
} 
// if (Red_R_Old == color[0] && Green_L_Old == color[4] && Blue_T_Old == color[8]) 
blank=0; 
} 
} else { 
if(blank>100000) { blank=0; for (byte i = 0; i < 30; i++) color[i] = 0;} 
blank++; 
} 
} 
//****************обработчик прерывания******************** 
ISR(TIMER2_OVF_vect) 
{ 
TCNT2 = tcnt2; 
pwm_time++; 
if(color[0] > pwm_time ) D22_High; else D22_LOW; 
if(color[1] > pwm_time ) D23_High; else D23_LOW; 
if(color[2] > pwm_time ) D24_High; else D24_LOW; 
if(color[3] > pwm_time ) D25_High; else D25_LOW; 
if(color[4] > pwm_time ) D26_High; else D26_LOW; 
if(color[5] > pwm_time ) D27_High; else D27_LOW; 
if(color[6] > pwm_time ) D28_High; else D28_LOW; 
if(color[7] > pwm_time ) D29_High; else D29_LOW; 
if(color[8] > pwm_time ) D30_High; else D30_LOW; 
if(color[9] > pwm_time ) D31_High; else D31_LOW; 
if(color[10] > pwm_time) D32_High; else D32_LOW; 
if(color[11] > pwm_time) D33_High; else D33_LOW; 
if(color[12] > pwm_time ) D34_High; else D34_LOW; 
if(color[13] > pwm_time) D35_High; else D35_LOW; 
if(color[14] > pwm_time) D36_High; else D36_LOW; 
if(color[15] > pwm_time ) D37_High; else D37_LOW; 
if(color[16] > pwm_time) D38_High; else D38_LOW; 
if(color[17] > pwm_time) D39_High; else D39_LOW; 
if(color[18] > pwm_time ) D40_High; else D40_LOW; 
if(color[19] > pwm_time) D41_High; else D41_LOW; 
if(color[20] > pwm_time) D42_High; else D42_LOW; 
if(color[21] > pwm_time ) D43_High; else D43_LOW; 
if(color[22] > pwm_time) D44_High; else D44_LOW; 
if(color[23] > pwm_time) D45_High; else D45_LOW; 
if(color[24] > pwm_time ) D46_High; else D46_LOW; 
if(color[25] > pwm_time) D47_High; else D47_LOW; 
if(color[26] > pwm_time) D48_High; else D48_LOW; 
if(color[27] > pwm_time ) D49_High; else D49_LOW; 
if(color[28] > pwm_time) D50_High; else D50_LOW; 
if(color[29] > pwm_time) D51_High; else D51_LOW; 
} 
 Огромное спасибо Чип'у за помощь!!!!!