hai
i am doing a project ir transmission .using analysIR i decode the ac codes and send the codes using ir sendRaw code but its sent only one code if i send another code previous code remove and then it send .
i wrote a sketch but its not compile where i did the mistake
#include <IRremote.h>
int i;
IRsend irsend;
int irSignal;
void setup()
{
Serial.begin(9600);
int khz=38;
Serial.println("sending power on presignal");
unsigned int irSignal[] ={4456,4360,576,1608,572,552,548,1612,568,1616,576,544,544, 528,568,1612,580,544,552,548, 548,1612,572,552,544,524,572, 1612,572,1612,568,552,544,1620,572,552,548,520,576,520,576, 1608,572,1612,572,1612,572,1612,568,1616,576,1612,572, 1612,572,1612,580,544,540,556,540,556,540,528,568,528,572, 528,576,1612,572,548,548,1616,568,1612,580,544,552,516,580, 520,576,1608,576,548,548,1612,568,552,548,524,572,1608,572, 1612,572,1612,580,5216,4428,4368,576,1608,576,548,548, 1612,572,1612,568,552,544,528,572,1608,572, 552,544,528, 580,1608,572,552,548,520,576,1608,572,1612,572,548,548, 1616,576,548,548,520,580,516,580,1604,576,1604,580,1604, 576,1608,576,1608,572,1620,576,1608,572,1608,576,548,548, 520,580,516,576,520,580,520,576,520,576,1612,568,552,544, 1620,576,1604,576,520,576,520,576,524,576,1608,572,524,576, 1612,568,552,544,528,568,1616,568,1616,576,1608,576};
irsend.sendRaw(irSignal, sizeof(irSignal) / sizeof(irSignal[0]), khz);
delay(1000);
}
void loop() {
int khz = 38;
char mode[]={'a','b','c','d'};
for(int i=0;i<sizeof(mode);i++)
{
unsigned int irSignal;
switch(mode*)*
-
{*
-
case'a':*
Serial.println("power off");
irSignal[]={4408,4384,568,1612,576,520,576,1612,580,1604,576,520,576, 520,572,1612,568,532,576,520,576,1612,576,520,576,524,572, 1608,572,1612,580,516,580,1612,576,548,548,1608,572,1612, 580,1604,576,1608,572,552,544,1616,576,1608,572,1620,568, 552,544,528,568, 528,568,528,576,1608,572,548,548,524,572, 1616,576,1608,572,1612,576,520,576,520,576,520,576,520,576, 520,576,524,568,528,568,528,568,1616,576,1608,572,1612,576, 1608,572,1612,568,5228,4432,4364,576,1608,572,524,572, 1616,572,1612,568,552,544,528,572,1612,576,520,572,552,544, 1616,576,548,548,528,568,1608,572,1612,576,520,576,1612, 580,520,576,1608,572,1612,568,1612,576,1608,572,524,572, 1616,576,1608,572,1620,572,524,568,528,568,552,544,552,544, 1612,580,516,576,524,572,1616,576,1608,572,1608,572,552, 544,552,544,552,540,528,568,532,576,520,576,524,568,524, 572,1616,576,1608,572,1612,568,1616,576,1612,568}; -
irsend.sendRaw(irSignal, sizeof(irSignal) / sizeof(irSignal[0]), khz);*
-
delay(1000);*
-
break;*
case'b':
Serial.println("temp 25");
irSignal[] ={4428, 4360, 572, 1612, 572, 524, 572,1612, 572, 1612, 568, 528, 568, 528, 572, 1612, 568, 528, 568, 532, 576, 1608, 576, 520, 576, 520, 576, 1608, 576, 1608, 572, 524, 572, 1616, 568, 528, 568, 528, 568, 528, 568, 1612, 572, 1612, 572, 1612, 568, 1616, 600, 1584, 608, 1580, 604, 1580, 600, 1584, 600, 496, 600, 496, 600, 496, 600, 496, 600, 496, 604, 1580, 600, 1584, 600, 496, 600, 496, 600, 1584, 600, 496, 600, 492, 604, 496, 600, 496, 600, 496, 600, 1584, 600, 1580, 604, 496, 600, 1584, 608, 1576, 604, 1580, 604, 5164, 4464, 4332, 600, 1584, 600, 496, 600, 1588, 604, 1576, 608, 488, 596, 500, 596, 1588, 608, 488, 596, 504, 604, 1580, 604, 492, 604, 492, 604, 1580, 604, 1580, 600, 492, 604, 1588, 596, 500, 596, 500, 596, 500, 596, 1584, 600, 1584, 596, 1588, 596, 1584, 600, 1588, 604, 1584, 600, 1584, 596, 1584, 600, 496, 600, 496, 600, 496, 600, 496, 600, 496, 604, 1580, 600, 1584, 600, 496, 600, 496, 600, 1584, 608, 488, 600, 496, 600, 496, 600, 496, 600, 496, 600, 1584, 600, 1584, 600, 496, 632, 1552, 628, 1556, 628, 1556, 572};
irsend.sendRaw(irSignal, sizeof(irSignal) / sizeof(irSignal[0]), khz); -
delay(1000);*
-
break;*
-
case'c':*
Serial.println("Temp20");
irSignal[] ={4432,4364,568,1612,572,524,572,1616,576,1608,576,520,576,520,568, 1612,568,532,576,520,576,1608,576,520,576,520,576,1608,576,1608, 572,524,572,1616,568,528,580,516,568,528,568,1616,568,1612,568, 1616,580,1604,576,1608,576,1612,572,1612,568,1616,576,520,568,528, 568,528,568,524,572,528,568,528,568,528,572,1612,568,528,568,1616, 580,516,580,516,568,528,580,1604,580,1604,576,520,576,1612,572,524, 572,1612,572,1612,568,1616,580,5216,4460,4332,604,1580,600,496,600, 1588,596,1584,608,488,600,496,600,1584,596,500,600,500,604,1580, 604,492,604,492,604,1580,604,1580,604,488,608,1580,600,500,596,500, 600,496,600,1580,600,1584,600,1584,596,1584,600,1584,600,1592,600, 1580,604,1580,600,496,600,496,600,496,604,488,608,492,604,492,604, 492,604,1580,604,492,604,1580,604,492,604,492,604,496,600,1584,600,1584,596,496,600,1588,608,488,608,1580,600,1584,600,1584,600};
irsend.sendRaw(irSignal, sizeof(irSignal) / sizeof(irSignal[0]), khz); -
delay(1000);*
-
break;*
-
case'd':*
Serial.println("mode auto");
irSignal[] ={4432,4376,576,1608,576,520,576,1608,572,1612,572,524,572,524,572, 1608,572,528,568,528,568,1620,580,516,576,520,576,1604,576,1608, 576,520,576,1612,568,528,580,516,580,516,568,1616,576,1604,580, 1604,576,1608,576,1608,572,1616,576,1608,576,1604,576,520,608,488, 608,488,600,496,600,496,600,500,604,492,608,1572,608,1576,604,1580, 604,492,604,492,604,492,604,1580,604,1580,600,496,600,496,600,492, 604,1584,600,1584,596,1584,576,5196,4460,4336,596,1584,600,496,600, 1588,604,1580,604,492,604,488,608,1576,604,496,600,496,600,1584, 600,496,600,496,600,1584,596,1588,596,496,600,1592,600,496,600,496, 600,496,600,1580,600,1584,600,1584,596,1584,600,1584,608,1580,600, 1584,600,1584,600,496,596,500,596,496,600,496,600,500,600,496,600, 496,600,1580,600,1584,600,1584,596,500,596,496,600,500,596,1588, 604,1576,608,488,608,488,596,500,596,1592,600,1580,604,1580,572};
}
irsend.sendRaw(irSignal, sizeof(irSignal) / sizeof(irSignal[0]), khz);
-
delay(1000);*
-
break;*
-
}*
-
}*
}
the error is expected primary-expression before ']' token
please help me
thank you