I build some project with arduino uno that need to store A/C remote codes and execute them on demand.
Something like IR sender. Hard thing is long A/C codes that is needing to be read raw and after that it need to transmit it raw.
It working perfectly when im using only two commands
unsigned ONCOLD16CAUTO ={};
unsigned OFF ={};
(power on, power off) but i need to store around 60 commands.
These IR commands use too many Sram and i dont know what to doo.
Any solution for me?
// Circuit description: Arduino UNO, PIN3 are connected to IR led with resistor 150ohm in series.
here is my scetch:
#include "IRremote.h"
IRsend irsend;
void setup()
{
Serial.begin(9600);
pinMode(7, INPUT_PULLUP);
pinMode(6, INPUT_PULLUP);
pinMode(13, OUTPUT);
digitalWrite(13, LOW);
}
int khz=38; //NB Change this default value as neccessary to the correct modulation frequency
// ON and 2O C° with 1 FAN heat
unsigned ONCOLD16CAUTO[] ={8972,4480,560,1664,556,1664,556,540,556,540,560,536,560,540,556,1664,556,1664,560,1660,560,1660,560,1664,556,540,556,540,556,540,560,536,560,1664,556,540,556,540,560,536,560,540,556,540,560,1664,556,1664,556,1664,556,540,556,540,556,540,560,536,560,540,556,540,560,536,560,540,556,540,556,540,560,540,556,540,556,540,560,1664,556,540,556,1664,556,540,560,536,560,540,556,540,556,540,560,536,560,540,556,540,556,540,560,540,556,540,556,540,560,536,560,1664,556,540,556,540,560,536,560,540,556,540,560,536,560,540,556,540,556,540,560,536,560,540,556,540,560,536,560,540,556,540,556,540,560,540,556,540,556,540,560,536,560,540,556,540,560,536,560,540,556,540,556,540,560,536,560,540,556,540,560,536,560,540,556,540,556,540,560,540,556,1664,556,540,560,1660,560,536,560,540,556,540,556,540,560,540,556,1664,556,1664,556,1664,556,1664,556,540,560,1664,556,1664,556,1664,584};
unsigned OFF[] ={8972,4480,560,1664,556,1664,556,540,556,540,560,536,560,540,556,1664,556,1664,560,1660,560,1660,560,1664,556,540,556,540,556,540,560,536,560,1664,556,540,556,540,560,536,560,540,556,540,560,1664,556,1664,556,1664,556,540,556,540,556,540,560,536,560,540,556,540,560,536,560,540,556,540,556,540,560,540,556,540,556,540,560,1664,556,540,556,1664,556,540,560,536,560,540,556,540,556,540,560,536,560,540,556,540,556,540,560,540,556,540,556,540,560,536,560,1664,556,540,556,540,560,536,560,540,556,540,560,536,560,540,556,540,556,540,560,536,560,540,556,540,560,536,560,540,556,540,556,540,560,540,556,540,556,540,560,536,560,540,556,540,560,536,560,540,556,540,556,540,560,536,560,540,556,540,560,536,560,540,556,540,556,540,560,540,556,1664,556,540,560,1660,560,536,560,540,556,540,556,540,560,540,556,1664,556,1664,556,1664,556,1664,556,540,560,1664,556,1664,556,1664,584};
int dugme1=0; //ON
int dugme2=0; //OFF
void loop() {
dugme1=digitalRead(7);
dugme2=digitalRead(6);
if (!dugme1){ //SEND COMMAND ON 16*C, AUTOFAN
digitalWrite(13,HIGH);
irsend.sendRaw(ONCOLD16CAUTO, sizeof(ONCOLD16CAUTO)/sizeof(int), khz);
delay(1000);
}
else if (!dugme2){ //SEND COMMAND OFF
digitalWrite(13,HIGH);
irsend.sendRaw(OFF, sizeof(OFF)/sizeof(int), khz);
delay(1000);
}
else {
digitalWrite(13,LOW);
}
}