--------------------------------------------------------------------
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?
If im trying to use tree or four function i get this message:
Code: Select all
Sketch uses 4754 bytes (14%) of program storage space. Maximum is 32256 bytes.
Global variables use 2088 bytes (101%) of dynamic memory, leaving -40 bytes for local variables. Maximum is 2048 bytes.
Not enough memory; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing your footprint.
Error compiling for board Arduino/Genuino Uno.
Code: Select all
#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
const 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};
const 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};
const unsigned OFF1[] ={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};
const unsigned OFF2[] ={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};
// POWEROFFVOX={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);
irsend.sendRaw(OFF1, sizeof(OFF1)/sizeof(int),khz);
delay(10000);
irsend.sendRaw(OFF2, sizeof(OFF2)/sizeof(int),khz);
delay(10000);
}
else if (!dugme2){ //SEND COMMAND OFF
digitalWrite(13,HIGH);
irsend.sendRaw(OFF, sizeof(OFF)/sizeof(int), khz);
delay(1000);
}
else {
digitalWrite(13,LOW);
}
}