Google-apper
Hovedmeny

Post a Comment On: Ken Shirriff's blog

"Using arbitrary remotes with the Arduino IRremote library"

21 Comments -

1 – 21 of 21
Blogger Unknown said...

Hi ! I want to know if it is a way of extracting raw data from HASH number .
Thank's !

January 28, 2010 at 2:39 AM

Blogger Ken Shirriff said...

No, the hash reduces the data down. If you want the raw data, it's in results->rawbuf, an array of length results->rawlen. The idea of the hash is it's a shortcut instead of processing the raw data yourself.

January 28, 2010 at 9:03 PM

Blogger Unknown said...

I need to find a way of compresing / decompresing rawdata so I can save it in EEPROM . Do you have any idea?

January 29, 2010 at 5:41 AM

Blogger Ken Shirriff said...

FolderBulk: the TV-B-Gone efficiently compresses its codes. There's a detailed description at TV-B-Gone Design under "Code Compression". My TV-B-Gone for Arduino uses the same compression.

February 5, 2010 at 12:13 AM

Anonymous Anonymous said...

Ken this is marvellous! I am doing a project with a Cypress PsoC and wanted to use an arbitrary remote controller as an input device.For a while i've been lingering with the lirc project and about ways to convert their input device data base to a set of #defines that could be compiled, but this is better - by far better.Now I can make a self learning receiver without even knowing the protocoll!!
It still needs some refinements,such as a solution for the toggle bit in RC5 but also a solution for remotes transmitting only a "repeat" code when a key is held permanently down.
But this is a good base to start with. Thanks!

Peter

March 1, 2010 at 5:38 AM

Anonymous Anonymous said...

Hi! You have done really a good job, the IR library for arduino is amazing. I'm trying to implement RCA protocol to decode a Xbox remote but I'm new to programming and it's still too difficult for me but however I'll try. I have problem to modify the .cpp file, I'm not able to write the function to handle the rca protocol, have you plan to implement it in the future in your library? Greetings from Italy and sorry for my ugly english!

June 21, 2010 at 7:35 PM

Anonymous chris said...

hi i'm using this sketch:
#include

int RECV_PIN = 11;

IRrecv irrecv(RECV_PIN);
int on = 768928;
decode_results results;

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

void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
switch (results.value){
case 768928D7 :
digitalWrite(13,HIGH);
break;
}

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

but i cant uploaded.It says:
10: error: invalid suffix "D7" on integer constant

Please Help

September 18, 2010 at 3:38 PM

Blogger Unknown said...

it only worked for me when i changed the "FNV_PRIME_32" to 2166136261

#define FNV_PRIME_32 2166136261
#define FNV_BASIS_32 2166136261


can you explain why please. i need to understan how the hash works

December 4, 2010 at 11:32 AM

Anonymous Vedran Kordić said...

A small correction for this snippet:

if (newval < oldval * .8) {
return 0;
}
else if (oldval < newval * .8) {
return 2;
}

The first expression is true for new values outside the 20% tolerance of the old value, but the second expression is true only for values outside 25% tolerance. You are multiplying different sides of the inequality each time, and (oldval < newval * .8) is equivalent to (newval > oldval * 1.25).

Cheers.

March 8, 2011 at 1:38 PM

Anonymous Edwin said...

Better and more understandable than most of the codes I have seen on this. I just have a question. I am using a (universal) remote set to do Philips RC5 codes.
If I press e.g. the 3, the code shown indeed is a '3' (twice) but if I then press it a second time, it will be '803'. Same for the other keys: 1-801, 2-802 etc. The Hashcodes are different though. Not a real problem but I was just wondering why this is?

January 12, 2012 at 12:43 AM

Anonymous Edwin said...

Ah, to answer my own question, it is most likely the 'toggle bit' that is set

January 12, 2012 at 3:01 AM

Blogger sitzia.it said...

hello, how can I send a hash code from Arduino with infrared transmitter?

March 29, 2012 at 2:11 AM

Blogger sitzia.it said...

hello, how can I send a hash code from Arduino with infrared transmitter?

March 29, 2012 at 2:12 AM

Blogger Ken Shirriff said...

Hi sitzia. You can't send a hash code, since the hash reduces the data down to a single number. There's not enough information in the hash code to send the original signal.

March 29, 2012 at 7:51 AM

Blogger Unknown said...

Hello , I'm searching for a way to handle NEC extended protocol (receiving & sending) . If I understood right it is compossed of 16 bits address and 16 bits command vs 8 bits in standart protocol . Is there a way for decode / send NEC extended with your library ? Thanks

April 17, 2012 at 11:42 AM

Blogger John Wolf said...

To get the loop to repeat after a TV remote command sent, I had to replace the irrecv.resume() method with irrecv.enableIRIn() method. I assume this resets the timers. I noticed in the IRremote source code if a known device is not detected, the code disallows a continuation without modifying the code. I didn't want to do that. I assume this is what was intended, even though not mentioned in your sketch.

October 16, 2012 at 9:09 PM

Blogger Cord Slatton said...

I have decoded my codes for my remote and your IR library is awesome, thanks for taking the time to make things easier on the rest of us!
I am however having trouble using an IR remote with other blocking functions, specifically an RFID reader...each one seems to need to wait all the time in order to be ready for the signal. What I want to be able to do is have a RFID reader running normally but be able to put it into manual mode via the IR remote. IF you need to see my code for the RFID or IR remote let me know, I didn't want to clutter things up if it wasn't needed. Thanks!

December 16, 2012 at 10:08 AM

Blogger Ryan said...

Looks like it's been awhile since this code's gotten some appreciation..so thanks for taking the time to write it and for keeping it up for others to use. I'm just starting out with coding/programming with an Arduino Uno, not much experience at this layer of computing. I picked up a little IR remote from Radio Shack on clearance along with an IR sensor that was meant to be an add-on for a Robotics kit they sell. I just finished running your code and producing hash values for all 8 buttons, and a few 2-button combos. The code was exactly what I needed (the little remote doesn't return any known protocols). Next step will be to come up with a project where I can use the hash values to actually control something, my 9 year old has been tasked with building something so we can control it, most likely will involve LEGO's. THanks again!


/* Hash values this program returned for the Radio Shack Robotics Kit IR Remote>>This is the B-2 bomber V-shaped remote:

* SW NUMBER (probable use/direction): hash values from IRhashdecode
*
* SW1 (up/raise/fwd): 'real' decode: 962814CA, hash decode: 962814CA
* SW2 (left): 'real' decode: B2CC429A, hash decode: B2CC429A
* SW3 (down/lower/rev): 'real' decode: 5990708A, hash decode: 5990708A
* SW4 (right): 'real' decode: B012615A, hash decode: B012615A
* SW5 (forward/extend): 'real' decode: 8D2A4BAF, hash decode: 8D2A4BAF
* SW6 (reverse/retract): 'real' decode: 1C22DE05, hash decode: 1C22DE05
* SW7 (left aux.): 'real' decode: 7A6E10BA, hash decode: 7A6E10BA (one pulse per button-press/momentary)
* SW8 (right aux.): 'real' decode: 97123E8A, hash decode: 97123E8A (one pulse per button-press/momentary)
*
* COMBO's:
* 2+5 (forward left): 'real' decode: 23D3B043, hash decode: 23D3B043
* 4+5 (forward right):'real' decode: 8D0FEBAB, hash decode: 8D0FEBAB
* 2+6 (reverse left): 'real' decode: B2CC4299, hash decode: B2CC4299
* 4+6 (reverse right) 'real' decode: B0126159, hash decode: B0126159
* 5+1 (forward up) 'real' decode: 72F8273, hash decode: 72F8273
* 5+3 (forward down) 'real' decode: CA97DE33, hash decode: CA97DE33
* 6+1 (reverse up) 'real' decode: 962814C9, hash decode: 962814C9
* 6+3 (reverse down) 'real' decode: 59907089, hash decode: 59907089

*
* other 2 button combos are available which return unique hash identifiers. Had enough fun for one night.

*

*
* The actual mark and space timing values produced with the IRrecvDemo were identical in "pattern" to the values given at thh LIRC project website for this particular remote. Actual time values were "off" a bit like Ken had explained they might be.

https://sf.net/p/lirc-remotes/code/ci/master/tree/remotes/radio_shack/kit-1-and-2.conf
*

March 20, 2016 at 2:00 AM

Blogger Unknown said...

HELLO, IM TRYING TO BUILD A REMOTE CONTROL FOR MY TV.
IM REALLY NEW ON ARDUINO. I KNOW IT CAN BE DONE WHAT I WANT. BUT I NEED A LOT OF HLEP IF YOU CAN PLEASE.
I GOT A VERY SMALL IR REMOTE CONTROL AND I WANT TO USE IT TO CONTROL MY TV, WHAT I WANT IS TO SAVE ALL THE CODES OF MY SAMSUNG TV INTO ARDUINO AND SAVE THE CODE OF MY SMALL REMOTE CONTROL.
SO IF A PUSH THE POWER BUTTON ON MY SMALL REMOTE THE ARDUINO WILL SEND THE TV CODE.
SOMETHING LIKE THIS, IF IRECV 80BF837C, IRSEND B54A50AF.
I JUST DONT KNOW HOW TO WRITE THE CODE, IF YOU CAN PLEASE HELP ME I REALLY APRECIATE IT.
SO SORRY FOR MY ENGLISH, I SPEACK SPANISH.
THANKS AGAIN.

August 13, 2016 at 7:30 PM

Blogger Joe T. said...

Finally! An authoritative answer to why my Pentax remote's data doesn't look like the HEX output!

Thanks for the explanation. I finally found this page from the page IRrecv.cpp

Thank you.

June 2, 2019 at 12:05 PM

Blogger Manu said...

Vou experimentar.
Muito obrigada por esta explicação.

April 22, 2021 at 1:33 AM

You can use some HTML tags, such as <b>, <i>, <a>

Comment moderation has been enabled. All comments must be approved by the blog author.

You will be asked to sign in after submitting your comment.
Please prove you're not a robot