Pages: [1]   Go Down
Author Topic: IR - recieve(d) code(s) - howto use ???  (Read 1497 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Code:
#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
  }
}
    
Logged

Sweden
Offline Offline
Jr. Member
**
Karma: 0
Posts: 61
Be patient, I'm a total newbie.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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(?)
Logged

Johannesburg. UTC+2
Offline Offline
Faraday Member
**
Karma: 105
Posts: 4691
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
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);

* jimIR_controls_MM.ino (6.25 KB - downloaded 10 times.)
« Last Edit: December 28, 2013, 12:36:56 pm by JimboZA » Logged

The Elders of the Internet know who I am
I'm on LinkedIn: http://www.linkedin.com/in/jimbrownza

Offline Offline
Sr. Member
****
Karma: 1
Posts: 322
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: