#include <IRremote.h>
#include <SoftwareSerial.h>
#include <avr/pgmspace.h>
const unsigned int power[] PROGMEM = {2600,850, 400,500, 350,550, 350,950, 450,850, 1350,850, 500,400, 450,450, 450,450, 450,450, 450,400, 500,400, 450,450, 900,850, 950,800, 950,450, 350,950, 450,450, 450,450, 850,900, 450,450, 900,450, 350,550, 350,950, 450,450, 450,450, 450,400, 900,450, 400,950, 450,400, 450,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; // UNKNOWN E3327DF7
const unsigned int power1[] PROGMEM= {2600,850, 450,450, 450,450, 400,900, 450,800, 1400,850, 450,450, 450,400, 500,400, 500,400, 450,450, 450,400, 500,400, 900,900, 850,900, 900,450, 450,850, 900,900, 850,900, 500,400, 900,450, 400,500, 400,900, 500,400, 450,450, 450,450, 850,450, 450,900, 450,400, 450,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; // UNKNOWN 87765094
const unsigned int ok[]PROGMEM = {2650,850, 350,500, 450,450, 450,900, 400,850, 1350,900, 450,400, 500,400, 450,450, 450,450, 450,400, 500,400, 450,450, 900,850, 900,900, 900,450, 400,900, 450,450, 450,400, 950,850, 450,450, 900,400, 450,450, 450,900, 450,400, 500,400, 450,450, 900,450, 350,950, 900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; // UNKNOWN D72E81D2
const unsigned int ok1[]PROGMEM = {2650,850, 350,500, 450,450, 450,900, 400,850, 1350,900, 450,400, 500,400, 450,450, 450,450, 450,400, 500,400, 450,450, 900,850, 900,900, 900,450, 400,900, 450,450, 450,400, 950,850, 450,450, 900,400, 450,450, 450,900, 450,400, 500,400, 450,450, 900,450, 350,950, 900,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; // UNKNOWN 4CA5E6FD
unsigned int displayIntpower;
unsigned int displayIntpower1;
unsigned int displayIntok;
unsigned int displayIntok1;
int k; // counter variable
IRsend irsend;
SoftwareSerial mySerial(9,10); // RX, TX
char ch;
//int i=0;
void setup() {
mySerial.begin(9600);
// while (!mySerial);
for (k = 0; k < 100; k++)
{
displayIntpower = pgm_read_word_near(power + k);
Serial.println(displayIntpower);
displayIntpower1 = pgm_read_word_near(power1 + k);
Serial.println(displayIntpower1);
displayIntok = pgm_read_word_near(ok + k);
Serial.println(displayIntok);
displayIntok1 = pgm_read_word_near(ok1 + k);
Serial.println(displayIntok1);
}
Serial.println();
}
void loop() {
ch=mySerial.read();
switch(ch)
{
case 'A': //POWER
irsend.sendRaw(displayIntpower,100,38);
delay(45);
irsend.sendRaw(displayIntpower1,100,38);
delay(45);
break;
case 'B': //OK
irsend.sendRaw(displayIntok,100,38);
delay(45);
irsend.sendRaw(displayIntok1,100,38);
delay(45);
break;
}
}