IR Remote to Keyboard

Hi guys!

I recently bought an Arduino Uno, and that’s when i figured out i could use him like a remote keyboard/mouse…

Problem is, my code work only once(i can reset the arduino, than it works again for only 1 button i press in the remote), i dunno if this is a code issue, or something else.

I’m using a receiver from the original remote (that works on the computer, but i don’t like his design xD, so i want to use other remote to simulate him), a IR Emitter, the remote that i want to use, an IR Receiver, and a Arduino of course ( lol ).

I will leave the code here, hope you guys can help me.

#include <IRremote.h>
#include <Ethernet.h>
#include <SPI.h>

#define UP 3261853764    //Mouse para cima
#define DOWN 3305092678  //Mouse para baixo
#define LEFT 1972149634  //Mouse para esquerda
#define RIGHT 1400905448 //Mouse para direita

#define INFO 1908947622  //Botao esquerdo mouse
#define GUIA 3468072230  //Botao direito mouse

#define MENU 1723810024  //Windows Key

#define VOLP 1752382022  //VOLUME +
#define VOLM 2209452902  //VOLUME -
#define MUTE 591444258   //MUDO

IRsend irsend;

int RECV_PIN = 2;
IRrecv irecv(RECV_PIN);
decode_results results;

unsigned int bWindows[34] = {
  300,1800,350,1750,250,1800,300,750,250,800,250,800,250,1800,300,750,250,1850,250,1800,300,750,250,1850,250,750,300,750,300,750,250,800,250,};

unsigned int bMouseUp[34] = {
  350,1750,350,1700,300,1800,300,750,300,750,300,750,250,1850,250,750,300,1800,250,800,250,800,250,750,300,750,300,750,250,800,250,800,250,};
unsigned int bMouseDown[34] = {
  350,1700,350,1750,350,1750,250,800,250,750,300,750,300,1800,250,800,250,750,300,1800,250,800,250,800,250,750,300,750,300,750,250,800,250,};
unsigned int bMouseLeft[34] = {
  300,1800,350,1700,300,1800,300,750,250,800,250,800,250,1800,300,750,250,1850,250,750,300,1800,250,1850,250,750,300,750,300,750,250,800,250,};
unsigned int bMouseRight[34] = {
  350,1700,350,1750,350,1750,300,750,250,750,300,750,300,1800,250,800,250,750,300,750,300,1800,250,1800,300,750,300,750,250,800,250,800,250,};

unsigned int leftButton[34] = {
  400,1700,300,1750,350,1750,300,750,300,750,250,800,250,1800,300,750,300,1800,250,800,250,750,300,1800,250,800,250,800,250,750,300,750,300,};
unsigned int rightButton[34] = {
  400,1700,300,1750,350,1750,300,750,300,750,250,800,250,1800,300,750,300,750,250,800,250,1800,300,750,300,750,250,800,250,800,250,750,300,};

unsigned int volUp[34] = {
  400,1700,300,1750,350,1750,300,750,300,750,250,800,250,1800,300,750,300,1800,250,800,250,1800,300,750,250,800,250,800,250,750,300,750,300,};
unsigned int volDown[34] = {
  400,1700,300,1750,350,1750,300,750,300,750,300,750,250,1800,300,750,300,750,250,1850,250,750,300,1800,250,800,250,800,250,750,300,750,300,};
unsigned int mute[34] = {
  350,1750,350,1750,300,1800,250,750,300,750,300,750,250,1850,250,750,300,750,300,1800,250,800,250,750,300,1800,250,800,250,800,250,750,300,};


void setup()
{
  Serial.begin(9600);
  irecv.enableIRIn();
}

void loop() {

  if (irecv.decode(&results)) {
    if(results.value == UP){
      for (int i = 0; i < 2; i++) {
        Serial.println("Mouse para cima pressionado");
        irsend.sendRaw(bMouseUp,34,38);
        delay(100);
      }
    }
    if(results.value == DOWN){
      for (int i = 0; i < 2; i++) {
        Serial.println("Mouse para baixo pressionado");
        irsend.sendRaw(bMouseDown,34,38);
        delay(100);
      }
    }
    if(results.value == LEFT){
      for (int i = 0; i < 2; i++) {
        Serial.println("Mouse para esquerda pressionado");
        irsend.sendRaw(bMouseLeft,34,38);
        delay(100);
      }
    }
    if(results.value == RIGHT){
      for (int i = 0; i < 2; i++) {
        Serial.println("Mouse para direita pressionado");
        irsend.sendRaw(bMouseRight,34,38);
        delay(100);
      }
    }
    if(results.value == INFO){
      for (int i = 0; i < 1; i++) {
        Serial.println("Botao esquerdo do mouse pressionado");
        irsend.sendRaw(leftButton,34,38);
        delay(500);
      }
    }
    if(results.value == GUIA){
      for (int i = 0; i < 1; i++) {
        Serial.println("Botao direito do mouse pressionado");
        irsend.sendRaw(rightButton,34,38);
        delay(500);
      }
    }
    if(results.value == MENU){
      for (int i = 0; i < 1; i++) {
        Serial.println("Windows Key pressionado");
        irsend.sendRaw(bWindows,34,38);
        delay(400);
      }
    }
    if(results.value == VOLP){
      for (int i = 0; i < 1; i++) {
        Serial.println("Aumentar volume pressionado");
        irsend.sendRaw(volUp,34,38);
        delay(100);
      }
    }
    if(results.value == VOLM){
      for (int i = 0; i < 1; i++) {
        Serial.println("Diminuir volume pressionado");
        irsend.sendRaw(volDown,34,38);
        delay(100);
      }
    }
    if(results.value == MUTE){
      for (int i = 0; i < 1; i++) {
        Serial.println("Mudo pressionado");
        irsend.sendRaw(mute,34,38);
        delay(500);
      }
    }
    irecv.resume();
    delay(100);
  }
}

Peace! And thanks in advance.

Sorry if i made some english error, i’m from Brazil

Common mistake: you must enable receiving after every send.

irrecv.enableIRIn();

Check out our 10 tips via my signature link for getting started with IR.

Thank you so much AnalysIR! It works fine using this code:

#include <IRremote.h>
#include <Ethernet.h>
#include <SPI.h>

#define BUT2 2908251746  //Seta para cima
#define BUT4 4120482440  //Seta para baixo
#define BUT6 742730860   //Seta para esquerda
#define BUT8 1747313982  //Seta para direita

#define UP 3261853764    //Mouse para cima
#define DOWN 3305092678  //Mouse para baixo
#define LEFT 1972149634  //Mouse para esquerda
#define RIGHT 1400905448 //Mouse para direita

#define INFO 1908947622  //Botao esquerdo mouse
#define GUIA 3468072230  //Botao direito mouse

#define MENU 1723810024  //Windows Key
#define OK 2331063592    //Enter

#define VOLP 1752382022  //VOLUME +
#define VOLM 2209452902  //VOLUME -
#define MUTE 591444258   //MUDO

IRsend irsend;

int RECV_PIN = 2;
IRrecv irecv(RECV_PIN);
decode_results results;

unsigned int arrowUp[34] = {
  400,1700,350,1750,300,1800,300,750,300,700,300,750,300,1800,300,750,300,1750,300,1800,250,800,250,750,300,1800,250,800,250,800,250,750,300,};
unsigned int arrowDown[34] = {
  350,1750,350,1700,300,1800,300,750,300,750,250,800,250,1800,300,750,300,750,250,1850,250,1800,300,750,250,1850,250,750,300,750,300,750,250,};
unsigned int arrowLeft[34] = {
  350,1750,350,1700,300,1800,300,750,300,750,300,750,250,1800,300,750,300,750,300,750,250,800,250,1800,300,1800,250,800,250,750,300,750,300,};
unsigned int arrowRight[34] = {
  400,1700,350,1750,300,1800,300,750,300,700,300,750,300,1800,300,750,300,700,300,750,300,750,300,1800,250,750,300,750,300,750,300,750,300,};

unsigned int bWindows[34] = {
  300,1800,350,1750,250,1800,300,750,250,800,250,800,250,1800,300,750,250,1850,250,1800,300,750,250,1850,250,750,300,750,300,750,250,800,250,};
unsigned int bEnter[34] = {
  400,1700,350,1700,350,1750,300,750,300,750,250,800,250,1800,300,750,300,750,250,800,250,800,250,750,300,1800,250,800,250,800,250,750,300,};

unsigned int bMouseUp[34] = {
  350,1750,350,1700,300,1800,300,750,300,750,300,750,250,1850,250,750,300,1800,250,800,250,800,250,750,300,750,300,750,250,800,250,800,250,};
unsigned int bMouseDown[34] = {
  350,1700,350,1750,350,1750,250,800,250,750,300,750,300,1800,250,800,250,750,300,1800,250,800,250,800,250,750,300,750,300,750,250,800,250,};
unsigned int bMouseLeft[34] = {
  300,1800,350,1700,300,1800,300,750,250,800,250,800,250,1800,300,750,250,1850,250,750,300,1800,250,1850,250,750,300,750,300,750,250,800,250,};
unsigned int bMouseRight[34] = {
  350,1700,350,1750,350,1750,300,750,250,750,300,750,300,1800,250,800,250,750,300,750,300,1800,250,1800,300,750,300,750,250,800,250,800,250,};

unsigned int leftButton[34] = {
  400,1700,300,1750,350,1750,300,750,300,750,250,800,250,1800,300,750,300,1800,250,800,250,750,300,1800,250,800,250,800,250,750,300,750,300,};
unsigned int rightButton[34] = {
  400,1700,300,1750,350,1750,300,750,300,750,250,800,250,1800,300,750,300,750,250,800,250,1800,300,750,300,750,250,800,250,800,250,750,300,};

unsigned int volUp[34] = {
  400,1700,300,1750,350,1750,300,750,300,750,250,800,250,1800,300,750,300,1800,250,800,250,1800,300,750,250,800,250,800,250,750,300,750,300,};
unsigned int volDown[34] = {
  400,1700,300,1750,350,1750,300,750,300,750,300,750,250,1800,300,750,300,750,250,1850,250,750,300,1800,250,800,250,800,250,750,300,750,300,};
unsigned int mute[34] = {
  350,1750,350,1750,300,1800,250,750,300,750,300,750,250,1850,250,750,300,750,300,1800,250,800,250,750,300,1800,250,800,250,800,250,750,300,};

void setup()
{
  Serial.begin(9600);
  irecv.enableIRIn();
}

void loop() {
  if (irecv.decode(&results)) {
    if(results.value == UP){
      for (int i = 0; i < 3; i++) {
        Serial.println("Mouse para cima pressionado");
        irsend.sendRaw(bMouseUp,34,38);
        irecv.enableIRIn();
        delay(10);
      }
    }else if(results.value == DOWN){
      for (int i = 0; i < 3; i++) {
        Serial.println("Mouse para baixo pressionado");
        irsend.sendRaw(bMouseDown,34,38);
        irecv.enableIRIn();
        delay(10);
      }
    }else if(results.value == LEFT){
      for (int i = 0; i < 3; i++) {
        Serial.println("Mouse para esquerda pressionado");
        irsend.sendRaw(bMouseLeft,34,38);
        irecv.enableIRIn();
        delay(10);
      }
    }else if(results.value == RIGHT){
      for (int i = 0; i < 3; i++) {
        Serial.println("Mouse para direita pressionado");
        irsend.sendRaw(bMouseRight,34,38);
        irecv.enableIRIn();
        delay(10);
      }
    }else if(results.value == INFO){
      for (int i = 0; i < 1; i++) {
        Serial.println("Botao esquerdo do mouse pressionado");
        irsend.sendRaw(leftButton,34,38);
        irecv.enableIRIn();
        delay(100);
      }
    }else if(results.value == GUIA){
      for (int i = 0; i < 1; i++) {
        Serial.println("Botao direito do mouse pressionado");
        irsend.sendRaw(rightButton,34,38);
        irecv.enableIRIn();
        delay(100);
      }
    }else if(results.value == MENU){
      for (int i = 0; i < 1; i++) {
        Serial.println("Windows Key pressionado");
        irsend.sendRaw(bWindows,34,38);
        irecv.enableIRIn();
        delay(100);
      }
    }else if(results.value == VOLP){
      for (int i = 0; i < 1; i++) {
        Serial.println("Aumentar volume pressionado");
        irsend.sendRaw(volUp,34,38);
        irecv.enableIRIn();
        delay(70);
      }
    }else if(results.value == VOLM){
      for (int i = 0; i < 1; i++) {
        Serial.println("Diminuir volume pressionado");
        irsend.sendRaw(volDown,34,38);
        irecv.enableIRIn();
        delay(70);
      }
    }else if(results.value == MUTE){
      for (int i = 0; i < 1; i++) {
        Serial.println("Mudo pressionado");
        irsend.sendRaw(mute,34,38);
        irecv.enableIRIn();
        delay(70);
      }
    }else if(results.value == BUT2){
      for(int i = 0; i < 1; i++){
        Serial.println("Seta para cima pressionado");
        irsend.sendRaw(arrowUp, 34, 38);
        irecv.enableIRIn();
        delay(30);
      }
    }else if(results.value == BUT8){
      for(int i = 0; i < 1; i++){
        Serial.println("Seta para baixo pressionado");
        irsend.sendRaw(arrowDown, 34, 38);
        irecv.enableIRIn();
        delay(30);
      }
    }else if(results.value == BUT4){
      for(int i = 0; i < 1; i++){
        Serial.println("Seta para esquerda pressionado");
        irsend.sendRaw(arrowLeft, 34, 38);
        irecv.enableIRIn();
        delay(30);
      }
    }else if(results.value == BUT6){
      for(int i = 0; i < 1; i++){
        Serial.println("Seta para direita pressionado");
        irsend.sendRaw(arrowRight, 34, 38);
        irecv.enableIRIn();
        delay(30);
      }
    }else if(results.value == OK){
      for(int i = 0; i < 1; i++){
        Serial.println("Enter pressionado");
        irsend.sendRaw(bEnter, 34, 38);
        irecv.enableIRIn();
        delay(70);
      }
    }
    irecv.resume();
    delay(100);
  }
}

However, if i try to add another button, like this:

#include <IRremote.h>
#include <Ethernet.h>
#include <SPI.h>

#define BUT2 2908251746  //Seta para cima
#define BUT4 4120482440  //Seta para baixo
#define BUT6 742730860   //Seta para esquerda
#define BUT8 1747313982  //Seta para direita

#define UP 3261853764    //Mouse para cima
#define DOWN 3305092678  //Mouse para baixo
#define LEFT 1972149634  //Mouse para esquerda
#define RIGHT 1400905448 //Mouse para direita

#define INFO 1908947622  //Botao esquerdo mouse
#define GUIA 3468072230  //Botao direito mouse
#define SAIR 158659426   //Esc
#define INPU 3459683302  //Janela + E --> Windows Explorer


#define MENU 1723810024  //Windows Key
#define OK 2331063592    //Enter

#define VOLP 1752382022  //VOLUME +
#define VOLM 2209452902  //VOLUME -
#define MUTE 591444258   //MUDO

#define CHLP 1595074756  //Page Up
#define CHLM 412973352   //Page Down

IRsend irsend;

int RECV_PIN = 2;
IRrecv irecv(RECV_PIN);
decode_results results;

unsigned int arrowUp[34] = {
  400,1700,350,1750,300,1800,300,750,300,700,300,750,300,1800,300,750,300,1750,300,1800,250,800,250,750,300,1800,250,800,250,800,250,750,300,};
unsigned int arrowDown[34] = {
  350,1750,350,1700,300,1800,300,750,300,750,250,800,250,1800,300,750,300,750,250,1850,250,1800,300,750,250,1850,250,750,300,750,300,750,250,};
unsigned int arrowLeft[34] = {
  350,1750,350,1700,300,1800,300,750,300,750,300,750,250,1800,300,750,300,750,300,750,250,800,250,1800,300,1800,250,800,250,750,300,750,300,};
unsigned int arrowRight[34] = {
  400,1700,350,1750,300,1800,300,750,300,700,300,750,300,1800,300,750,300,700,300,750,300,750,300,1800,250,750,300,750,300,750,300,750,300,};

unsigned int bWindows[34] = {
  300,1800,350,1750,250,1800,300,750,250,800,250,800,250,1800,300,750,250,1850,250,1800,300,750,250,1850,250,750,300,750,300,750,250,800,250,};
unsigned int bEnter[34] = {
  400,1700,350,1700,350,1750,300,750,300,750,250,800,250,1800,300,750,300,750,250,800,250,800,250,750,300,1800,250,800,250,800,250,750,300,};
unsigned int bEsc[34] = {
  300,1750,350,1750,350,1750,250,800,250,800,250,750,300,1800,250,800,250,800,250,1800,300,1800,250,1800,300,750,300,750,250,800,250,800,250,};
unsigned int myPc[34] = {
  350,1700,350,1750,350,1700,350,750,250,800,250,750,300,1800,250,800,250,1800,300,1800,250,1850,250,1800,300,750,250,800,250,800,250,750,300,};

unsigned int bMouseUp[34] = {
  350,1750,350,1700,300,1800,300,750,300,750,300,750,250,1850,250,750,300,1800,250,800,250,800,250,750,300,750,300,750,250,800,250,800,250,};
unsigned int bMouseDown[34] = {
  350,1700,350,1750,350,1750,250,800,250,750,300,750,300,1800,250,800,250,750,300,1800,250,800,250,800,250,750,300,750,300,750,250,800,250,};
unsigned int bMouseLeft[34] = {
  300,1800,350,1700,300,1800,300,750,250,800,250,800,250,1800,300,750,250,1850,250,750,300,1800,250,1850,250,750,300,750,300,750,250,800,250,};
unsigned int bMouseRight[34] = {
  350,1700,350,1750,350,1750,300,750,250,750,300,750,300,1800,250,800,250,750,300,750,300,1800,250,1800,300,750,300,750,250,800,250,800,250,};

unsigned int leftButton[34] = {
  400,1700,300,1750,350,1750,300,750,300,750,250,800,250,1800,300,750,300,1800,250,800,250,750,300,1800,250,800,250,800,250,750,300,750,300,};
unsigned int rightButton[34] = {
  400,1700,300,1750,350,1750,300,750,300,750,250,800,250,1800,300,750,300,750,250,800,250,1800,300,750,300,750,250,800,250,800,250,750,300,};

unsigned int volUp[34] = {
  400,1700,300,1750,350,1750,300,750,300,750,250,800,250,1800,300,750,300,1800,250,800,250,1800,300,750,250,800,250,800,250,750,300,750,300,};
unsigned int volDown[34] = {
  400,1700,300,1750,350,1750,300,750,300,750,300,750,250,1800,300,750,300,750,250,1850,250,750,300,1800,250,800,250,800,250,750,300,750,300,};
unsigned int mute[34] = {
  350,1750,350,1750,300,1800,250,750,300,750,300,750,250,1850,250,750,300,750,300,1800,250,800,250,750,300,1800,250,800,250,800,250,750,300,};

unsigned int pageUp[34] = {
  350,1750,350,1700,300,1800,300,750,300,750,300,750,250,1800,300,750,300,750,300,750,250,800,250,750,300,750,300,750,250,800,250,800,250,};
unsigned int pageDown[34] = {
  300,1750,350,1750,350,1750,250,800,250,750,300,750,300,1800,250,800,250,800,250,1800,300,1800,250,800,250,750,300,750,250,800,250,800,250,};

void setup()
{
  Serial.begin(9600);
  irecv.enableIRIn();
}

void loop() {
  if (irecv.decode(&results)) {
    if(results.value == UP){
      for (int i = 0; i < 3; i++) {
        Serial.println("Mouse para cima pressionado");
        irsend.sendRaw(bMouseUp,34,38);
        irecv.enableIRIn();
        delay(10);
      }
    }else if(results.value == DOWN){
      for (int i = 0; i < 3; i++) {
        Serial.println("Mouse para baixo pressionado");
        irsend.sendRaw(bMouseDown,34,38);
        irecv.enableIRIn();
        delay(10);
      }
    }else if(results.value == LEFT){
      for (int i = 0; i < 3; i++) {
        Serial.println("Mouse para esquerda pressionado");
        irsend.sendRaw(bMouseLeft,34,38);
        irecv.enableIRIn();
        delay(10);
      }
    }else if(results.value == RIGHT){
      for (int i = 0; i < 3; i++) {
        Serial.println("Mouse para direita pressionado");
        irsend.sendRaw(bMouseRight,34,38);
        irecv.enableIRIn();
        delay(10);
      }
    }else if(results.value == INFO){
      for (int i = 0; i < 1; i++) {
        Serial.println("Botao esquerdo do mouse pressionado");
        irsend.sendRaw(leftButton,34,38);
        irecv.enableIRIn();
        delay(100);
      }
    }else if(results.value == GUIA){
      for (int i = 0; i < 1; i++) {
        Serial.println("Botao direito do mouse pressionado");
        irsend.sendRaw(rightButton,34,38);
        irecv.enableIRIn();
        delay(100);
      }
    }else if(results.value == MENU){
      for (int i = 0; i < 1; i++) {
        Serial.println("Windows Key pressionado");
        irsend.sendRaw(bWindows,34,38);
        irecv.enableIRIn();
        delay(100);
      }
    }else if(results.value == VOLP){
      for (int i = 0; i < 1; i++) {
        Serial.println("Aumentar volume pressionado");
        irsend.sendRaw(volUp,34,38);
        irecv.enableIRIn();
        delay(70);
      }
    }else if(results.value == VOLM){
      for (int i = 0; i < 1; i++) {
        Serial.println("Diminuir volume pressionado");
        irsend.sendRaw(volDown,34,38);
        irecv.enableIRIn();
        delay(70);
      }
    }else if(results.value == MUTE){
      for (int i = 0; i < 1; i++) {
        Serial.println("Mudo pressionado");
        irsend.sendRaw(mute,34,38);
        irecv.enableIRIn();
        delay(70);
      }
    }else if(results.value == BUT2){
      for(int i = 0; i < 1; i++){
        Serial.println("Seta para cima pressionado");
        irsend.sendRaw(arrowUp, 34, 38);
        irecv.enableIRIn();
        delay(30);
      }
    }else if(results.value == BUT8){
      for(int i = 0; i < 1; i++){
        Serial.println("Seta para baixo pressionado");
        irsend.sendRaw(arrowDown, 34, 38);
        irecv.enableIRIn();
        delay(30);
      }
    }else if(results.value == BUT4){
      for(int i = 0; i < 1; i++){
        Serial.println("Seta para esquerda pressionado");
        irsend.sendRaw(arrowLeft, 34, 38);
        irecv.enableIRIn();
        delay(30);
      }
    } else if(results.value == BUT6){
      for(int i = 0; i < 1; i++){
        Serial.println("Seta para direita pressionado");
        irsend.sendRaw(arrowRight, 34, 38);
        irecv.enableIRIn();
        delay(30);
      }
    }else if(results.value == OK){
      for(int i = 0; i < 1; i++){
        Serial.println("Enter pressionado");
        irsend.sendRaw(bEnter, 34, 38);
        irecv.enableIRIn();
        delay(70);
      }
    }else if(results.value == CHLP){
      for(int i = 0; i < 1; i++){
        Serial.println("Page Up pressionado");
        irsend.sendRaw(pageUp, 34, 38);
        irecv.enableIRIn();
        delay(70);
      }
    }
    irecv.resume();
    delay(100);
  }
}

It just doesn’t work, can you tell me if this is a issue with my code, or maybe there is a limitation of how many buttons arduino can handle ?

possible(probably) running out of SRAM.

Is there a way to fix this ?

Another problem you have is that your signals are 33 long - not 34.

So remove the last comma in the array definition & change the 34 to 33 .

(these probably don't cause any serious issue, but better to clean them up as well.

Alternatively use code like this: (note the way the size of the array is automatically calculated)

/*
Automatically Generated by AnalysIR - Batch Export Utility
Registered to: xxxxxxxx
Session History
Type : Key : Value : Bits
0 : RAW :  :  : 0
*/

// NB: Not all protocols are supported by IRremote or IRLib. You may need to edit the code below manually
// Automatically Generated by AnalysIR for xxxxxxxx, visit http://www.AnalysIR.com or email info@....... for further details
int khz=38; //NB Change this default value as neccessary to the correct modulation frequency


unsigned int Signal_0_0[] = {300,1800,350,1700,300,1800,300,750,250,800,250,800,250,1800,300,750,250,1850,250,750,300,1800,250,1850,250,750,300,750,300,750,250,800,250}; //AnalysIR Batch Export - RAW

irsend.sendRaw(Signal_0_0, sizeof(Signal_0_0)/sizeof(int), khz); //AnalysIR Batch Export - RAW
 // AnalysIR IR Protocol: RAW, Key:

Is there a way to fix this ?

Yes: 1. store the arrays in Flash (PROGMEM) and copy them into a RAM array just before sending. You need to search this forum or google to find examples. 2. Get an Arduino with more SRAM. 3. Decode the signal into binary & extend the library to support this protocol. This is more cois more advanced but means you only have to use 2 or 4 bytes per signal vs 64 now. 4. Identify repeating patterns in the signals and store them only once.

Thanks AnalysIR ! I will try the hints that you gave me, and then post the working code ! =D

another thing to try:

divide the values in the existing arrays by 10 (or 50) and define the arrays as unsigned char (instead of unsigned int).

(IRremote records times in multiples of 50, by default)

Then before you send each signal copy the array into a new array which is defined as 'unsigned int' and multiply each value by 10 or 50 as you are doing this. Then send the signal using sendRAW.

This will reduce your SRAM usage by about 50%, which may suffice for your needs.

AnalysIR: another thing to try:

divide the values in the existing arrays by 10 (or 50) and define the arrays as unsigned char (instead of unsigned int).

(IRremote records times in multiples of 50, by default)

Then before you send each signal copy the array into a new array which is defined as 'unsigned int' and multiply each value by 10 or 50 as you are doing this. Then send the signal using sendRAW.

This will reduce your SRAM usage by about 50%, which may suffice for your needs.

Well, i'm kinda new to Arduino. Could you give me a example about this ? I think i get the idea, but can't actually write it in code xD

AnalysIR: Another problem you have is that your signals are 33 long - not 34.

So remove the last comma in the array definition & change the 34 to 33 .

(these probably don't cause any serious issue, but better to clean them up as well.

Alternatively use code like this: (note the way the size of the array is automatically calculated)

/*
Automatically Generated by AnalysIR - Batch Export Utility
Registered to: xxxxxxxx
Session History
Type : Key : Value : Bits
0 : RAW :  :  : 0
*/

// NB: Not all protocols are supported by IRremote or IRLib. You may need to edit the code below manually // Automatically Generated by AnalysIR for xxxxxxxx, visit http://www.AnalysIR.com or email info@....... for further details int khz=38; //NB Change this default value as neccessary to the correct modulation frequency

unsigned int Signal_0_0[] = {300,1800,350,1700,300,1800,300,750,250,800,250,800,250,1800,300,750,250,1850,250,750,300,1800,250,1850,250,750,300,750,300,750,250,800,250}; //AnalysIR Batch Export - RAW

irsend.sendRaw(Signal_0_0, sizeof(Signal_0_0)/sizeof(int), khz); //AnalysIR Batch Export - RAW // AnalysIR IR Protocol: RAW, Key:

Same problem using this code, it doesn't work after more than 15 buttons. Now i'll try the other things that you said to me, and see if something works.

Yes, good idea.

(Its unlikely you will get people to write code for you, but they are usually willing to help improve your own efforts)