Go Down

Topic: IR - recieve(d) code(s) - howto use ??? (Read 1 time) previous topic - next topic

lykkedk

Hello all.

I am playing with an IR-reciever i plugged out off, some old electronics, i can't tell the Khz off the thing, but it has three legs 1=OUT 2=GND 3=+5vdc (VCC).

I sat it up on the Arduino, and had a lot of problems, recieving codes, until i found this code on the net :

http://www.arcfn.com/2009/08/multi-protocol-infrared-remote-library.html

Quote
#include <IRremote.h>

int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
}

void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    irrecv.resume(); // Receive the next value
  }
}


Now i am getting code's... ect. REMOTE DOWN = 801491a9 - but i can't figure out howto go from here ??? - I tried diferent code's to catch the output, but can't make it work. ?

Can any here help me further on ???

Jesper.

martijntechno

i used this for testing a big program, i hope this helps otherwise repley


Code: [Select]
#include <IRremote.h>
#include <LiquidCrystal.h>


LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

int RECV_PIN = 28;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
 Serial.begin(9600);
 irrecv.enableIRIn(); // Start the receiver
 lcd.begin(16, 2);
}

void loop() {
 
 if (irrecv.decode(&results)) {
   switch (results.value)  {
     case 0xF4BA2988:
       lcd.clear();
       lcd.print("aan/uit");
       break;
     case 0xE13DDA28:
       lcd.clear();
       lcd.print("nummer 1");
       break;
     case 0xAD586662:
       lcd.clear();
       lcd.print("nummer 2");
       break;
     case 0x273009C4:
       lcd.clear();
       lcd.print("nummer 3");
       break;
     case 0xF5999288:
       lcd.clear();
       lcd.print("nummer 4");
       break;
     case 0x731A3E02:
       lcd.clear();
       lcd.print("nummer 5");
       break;
     case 0x2C452C6C:
       lcd.clear();
       lcd.print("nummer 6");
       break;
     case 0x4592E14C:
       lcd.clear();
       lcd.print("nummer 7");
       break;
     case 0x6825E53E:
       lcd.clear();
       lcd.print("nummer 8");
       break;
     case 0x8B8510E8:
      lcd.clear();
       lcd.print("nummer 9");
       break;
  case 0x8AF13528:
       lcd.clear();
       lcd.print("OK");
       break;  
  }
   
   
   
   

   
   irrecv.resume(); // Receive the next value
 }
}
   

SimLego

An extremely cool project would be to make a translator for IR remotes. Use your old favorite remote from an outdated or defective set, let the Arduino read the signals from it, and transmit the codes that your new set uses from that new, frustratingly user hostile remote. I'm sure someone must have tried that(?)

JimboZA

#3
Dec 28, 2013, 06:34 pm Last Edit: Dec 28, 2013, 06:36 pm by JimboZA Reason: 1
I used the attached code to have a tv remote control a robot.... volume up was say speed up etc etc, using lines like this:

Code: ( Snippet. Full sketch attached) [Select]
void loop() {
 if (irrecv.decode(&results)) {
   Serial.println(results.value, DEC);
   irrecv.resume(); // Receive the next value
   
   //now act on various key presses
   
   // *********************** STOP
   if (results.value == 3148 || results.value == 1100) {  
     motorA_speed = 0;
     motorB_speed = 0;
     Serial.print("Stopping ");
     Serial.print(motorA_speed);
     Serial.print("\t");
     Serial.println(motorB_speed);
Arduino ethernet server here.... http://jimboza.gotdns.com:8085/

No PMs for help please

RandallR


An extremely cool project would be to make a translator for IR remotes. Use your old favorite remote from an outdated or defective set, let the Arduino read the signals from it, and transmit the codes that your new set uses from that new, frustratingly user hostile remote. I'm sure someone must have tried that(?)


I am looking to do something very much like that.  Currently I have three remote and I have to use the right one to do the function that I want.
I have a TV remote.  It can be used to change channels.  However, the audio output goes to an amplifier.  The TV audio output is fixed so the volume must be controlled with the Amp's remote.  I use a compute with a TV card as a DVR and also play AVI, MP4, DVD and such.  That is a different remote

I am looking to translate the codes from one remote into the corresponding codes for the other two remotes.  Therefore, a "Volume Up" code from one remote will cause the volume to go up for all devices.

I am not fond of the "IRremote" library and have been writing my own.

Go Up