0
Offline
God Member
Karma: 0
Posts: 572
|
 |
« Reply #15 on: December 16, 2008, 10:42:57 pm » |
The code was written for version 0011 of the IDE. You are running version 0012. There are a few fixes floating around on the forum. Check the last post here: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1221741304/52#52But also do some searching around.
|
|
|
|
|
Logged
|
|
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 10
Arduino rocks
|
 |
« Reply #17 on: December 17, 2008, 08:26:23 am » |
No that code worked fine for me, make sure you've got the NECIR library installed.
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Newbie
Karma: 0
Posts: 3
Arduino rocks
|
 |
« Reply #18 on: February 01, 2009, 02:20:50 pm » |
I have the NECIRrcv.h library added to the Arduino sw but still get compiling errors when compiling the small program that is listed above:
In file included from C:\Program Files\arduino-0012\hardware\cores\arduino/WProgram.h:4,
c:/program files/arduino-0012/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:80: error: expected unqualified-id before 'int'
c:/program files/arduino-0012/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:80: error: expected `)' before 'int'
......
c:/program files/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:\Program Files\arduino-0012\hardware\cores\arduino/WProgram.h:6,
Do I need some other library? WProgram?
Please help... I am totally new and "desperately" need a working NEC IR receiving sketch.
Thanx...
|
|
|
|
|
Logged
|
|
|
|
|
Florida
Offline
Full Member
Karma: 0
Posts: 171
1 Cor 10:31
|
 |
« Reply #19 on: February 01, 2009, 03:33:20 pm » |
did you check out the what trialex posted above?
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Newbie
Karma: 0
Posts: 3
Arduino rocks
|
 |
« Reply #20 on: February 03, 2009, 06:01:55 am » |
I think I can take two things from this post:
1. Include #undef int somewhere
2. * Moved insertion of #include <WProgram.h> to after any comments and #include statements in the main sketch file. This means that an #include <stdlib.h> now works.
If one of these or both are supposed to "do the job" where do I have to change code then? In "NECIRrcv.h" or in the "main sketch calling "NECIRrcv.h"?
Peter.
|
|
|
|
|
Logged
|
|
|
|
|
The netherlands, Zeeland
Offline
Newbie
Karma: 0
Posts: 30
Arduino rocks
|
 |
« Reply #21 on: March 06, 2009, 11:11:56 am » |
Hi, I am a noob at Arduino en English...  And I have a problem, I use a IR Photodiode for this library, does that work? And do you must connect the Photodiode to a analog pin or a digital?
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
God Member
Karma: 2
Posts: 849
Arduino rocks!
|
 |
« Reply #22 on: March 06, 2009, 02:05:52 pm » |
The IR signal from a remote control has a carrier frequency, usually around 38kHz or 40kHz. This helps filter out noise because the system can ignore any signal that's not at the carrier frequency.
The IR modules discussed in this thread strip out the carrier and just output the signal. If you use a straight photodiode connected to an Arduino pin, the pin will see the carrier frequency, and you will have to deal with that signal.
You would connect it to a digital input, but connecting it isn't completely straightforward.
|
|
|
|
|
Logged
|
|
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 1
Arduino rocks
|
 |
« Reply #24 on: March 13, 2009, 02:41:51 am » |
Ah this is really cool!
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 13
Arduino rocks
|
 |
« Reply #25 on: May 22, 2009, 12:31:31 am » |
Where did this code go?
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 13
Arduino rocks
|
 |
« Reply #26 on: May 22, 2009, 11:34:08 am » |
does anyone still have this library? can you send it to me?
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Ottawa, Canada
Offline
Newbie
Karma: 0
Posts: 9
Arduino... it's gonna work?
|
 |
« Reply #28 on: August 10, 2009, 08:56:10 pm » |
Had same compiler problems as Jacobson and others. Finally got this working on Duemilanove with ATMEGA328 and using Arduino 16. Secret was to add: #include <WProgram.h> to main sketch like this: // look for IR codes and print them as they are received
#include <WProgram.h> #include <NECIRrcv.h> #define IRPIN 4 // pin that IR detector is connected to
NECIRrcv ir(IRPIN) ;
void setup() { Serial.begin(9600) ; Serial.println("NEC IR code reception") ; ir.begin() ; }
void loop() { unsigned long ircode ; while (ir.available()) { ircode = ir.read() ; Serial.print("got code: 0x") ; Serial.println(ircode,HEX) ; } }
Works like a charm! Regards to all, Mark Ottawa, Canada.
|
|
|
|
|
Logged
|
|
|
|
|
London
Offline
Faraday Member
Karma: 6
Posts: 6226
Have fun!
|
 |
« Reply #29 on: August 10, 2009, 09:10:57 pm » |
If you are going to be using this library in more than one sketch, instead of adding #include <WProgram.h> to each sketch that uses the library, you can add it as the first line in the NECIRrcv.h file.
|
|
|
|
|
Logged
|
|
|
|
|
|