Infared (IR) Remote Control Library

Hey everyone.

I've been looking around a bit the past couple of days to find a nice library to let me interface with an IR receiver so i can use a remote control to make the Arduino do things.

Of course, it should be interrupt driven so i can do other things in the meantime.

I did find one good one though,
arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1210243556Link

Problem is it really doesn't seem happy about running on my Duemilanove since when i try to compile i get a big whack of errors.

Does anyone know how i can get this working?
Surely having IR remote control is a fairly common thing for an Arduino project, actually I'm surprised there isn't an official library!

Thanks for any help in advance.
Gav

It would be helpful if you included the errors.

My first guess would be the library may have been written for a pre-0012 environment--one of the changes in 0012 killed a lot of third-party libraries and they require a small modification.

--Phil.

ah, that does make some sense.
i guess i could try using one of the old compilers, that could be it.

but since you asked, the errors are:

c:/documents and settings/gavin/desktop/arduino-0012/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:111: error: expected `)' before 'int'


c:/documents and settings/gavin/desktop/arduino-0012/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:144: error: expected identifier before '(' token


c:/documents and settings/gavin/desktop/arduino-0012/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:144: error: expected `)' before '(' token


c:/documents and settings/gavin/desktop/arduino-0012/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:144: error: expected ',' or '...' before '(' token


c:/documents and settings/gavin/desktop/arduino-0012/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:144: error: expected initializer before ')' token


c:/documents and settings/gavin/desktop/arduino-0012/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:176: error: '__compar_fn_t' has not been declared


In file included from C:\Documents and Settings\Gavin\Desktop\arduino-0012\hardware\cores\arduino/WProgram.h:6,

I just downloaded the 0011 environment and tried a basic compile and it works perfectly!

Thanks for the tip follower.

now, the question is what are those modifications you were talking about?

I believe it's putting code something like this in the correct place:

#undef int()

Have a search on the forums--there's been quite a bit of discussion about it.

--Phil.

which kind of IR reciever/trasnmitter are you using?
how did you phisically linked it to the arduino?

ciao

Thanks again for the tip follower, ill have a crack at it soon!

Davide, i actually haven't hooked up the reciever to the arduino yet (because i had to order one) but i was going to follow jmknapp's example in the thread before and use a Vishay TSOP1138
http://arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1210243556Link

I'm not looking to transmit anything from the arduino though.
Maybe ill save that for a different project :slight_smile:

Me again...

I was working on getting that IR library working under the 0012 envrionment using what follower was talking about before.
I gave it a quick search and the #undef int() was the way to go apprently.

however, the library doesnt use stdio.h which you are supposed to put it in before and of course, i still got pretty much the same errors.

so, my question is one of two things, 1) where do i go next to try and get it working? or 2) should i really care? coding in the 0011 environment seems the same, so who cares right?

Gav

I would like to use my small JVC remote control with arduino. I have JVC RM-V716V. Does all remote are 38khz? I heard this remote is 32KHZ. Can we use 38KHZ Infrared Receiver modeule from Radio Shack with JVC remote?

I thought about that myself, i tested my NEC remote lying around and it worked perfectly (naturally) but it seemed ANY remote i tried worked too. If i had some JVC gear i would test it out for you but i dont.

actually, MAYBE i have ONE thing, ill have a look when i get home and post back if so.

Otherwise, does it really HAVE to be the JVC? There are some nice universal remotes out there and theyre practically guaranteed to work.

But all else failing, if you're sure the JVC is 32K, then getting a 32K reciever sounds like a safe bet to me.

I've used a Vishay TSOP1736 (36KHz) IR receiver.

I tried it with a 7 or 8 different IR remotes from 6 or 7 different manufacturers (including JVC), and I can extract the data pretty reliably for all of them.

They use different data encoding techniques, but that doesn't seem to be a problem for the TSOP1736. (It is for my software :-))

Looking at the Vishay IR Receiver modules, they mostly span 30KHz to 40KHz, with 36KHz nearest to the 'average', so if you may be using a range of IR remotes' you might want to get 36KHz on the basis that it is closer to the 'middle'. (Having said that, they are very tolerant and pleasant to work with).

I have stayed with Arduino-11 for now as my code was built around the internals of the millis() timer (naughty but quick). I don't have a reason to move that code to Arduino-12 when there is so much else I need to do.