Pages: [1]   Go Down
Author Topic: IR-Remote with Arduino Uno Rev3, Libraries  (Read 1551 times)
0 Members and 1 Guest are viewing this topic.
Belgium
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I'm new to this forum and arduino in particular. So I'll hope you forgive me if I make some mistakes or ask some stupid questions...

I'm not (that) new to microcontrollers however and I've done most of the basic programs without problems.


My problems however started when I tried to expand on these basics by use of an IR-remote ( it's fun to fade a led by arduino, it's more fun to do so remotely).

I'm using this: http://iprototype.be/products/kits/remote-ir-kit
Libraries: http://iprototype.be/docs/remote-ir-kit-voorbeeld-code-en-library.zip
Wired like this: http://iprototype.be/docs/ir-reciever-wire_bb.png

(When wired like this, used with the AnalogReadSerial, I can see the numbers changing when I press the buttons..)
(But from what i could find out in some other places the "signal" is supposed to go to a DI instead of a AI)


Now from what I've read, I'm supposed to use the "IRrec" to sort of map out which button sends which code so I can use it in a "switch case" or something ;-)
However when i try to compile one of the sample programs that are with the libraries, I get the following errors:

Quote
In file included from C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:13:
C:\Users\Niels\Documents\Arduino\libraries\IRremote\/IRremoteInt.h:87: error: 'uint8_t' does not name a type
C:\Users\Niels\Documents\Arduino\libraries\IRremote\/IRremoteInt.h:88: error: 'uint8_t' does not name a type
C:\Users\Niels\Documents\Arduino\libraries\IRremote\/IRremoteInt.h:89: error: 'uint8_t' does not name a type
C:\Users\Niels\Documents\Arduino\libraries\IRremote\/IRremoteInt.h:92: error: 'uint8_t' does not name a type
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp: In member function 'void IRsend::mark(int)':
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:173: error: 'delayMicroseconds' was not declared in this scope
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp: In member function 'void IRsend::space(int)':
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:181: error: 'delayMicroseconds' was not declared in this scope
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp: In member function 'void IRsend::enableIROut(int)':
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:200: error: 'OUTPUT' was not declared in this scope
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:200: error: 'pinMode' was not declared in this scope
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:201: error: 'LOW' was not declared in this scope
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:201: error: 'digitalWrite' was not declared in this scope
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp: In constructor 'IRrecv::IRrecv(int)':
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:217: error: 'volatile struct irparams_t' has no member named 'recvpin'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:218: error: 'volatile struct irparams_t' has no member named 'blinkflag'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp: In member function 'void IRrecv::enableIRIn()':
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:241: error: 'volatile struct irparams_t' has no member named 'rcvstate'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:242: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:246: error: 'volatile struct irparams_t' has no member named 'recvpin'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:246: error: 'INPUT' was not declared in this scope
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:246: error: 'pinMode' was not declared in this scope
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp: In member function 'void IRrecv::blink13(int)':
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:252: error: 'volatile struct irparams_t' has no member named 'blinkflag'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:254: error: 'OUTPUT' was not declared in this scope
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:254: error: 'pinMode' was not declared in this scope
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp: In function 'void __vector_9()':
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:268: error: 'volatile struct irparams_t' has no member named 'recvpin'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:268: error: 'digitalRead' was not declared in this scope
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:271: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:273: error: 'volatile struct irparams_t' has no member named 'rcvstate'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:275: error: 'volatile struct irparams_t' has no member named 'rcvstate'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:284: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:285: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:287: error: 'volatile struct irparams_t' has no member named 'rcvstate'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:293: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:295: error: 'volatile struct irparams_t' has no member named 'rcvstate'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:300: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:302: error: 'volatile struct irparams_t' has no member named 'rcvstate'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:310: error: 'volatile struct irparams_t' has no member named 'rcvstate'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:321: error: 'volatile struct irparams_t' has no member named 'blinkflag'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:323: error: 'B00100000' was not declared in this scope
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:326: error: 'B11011111' was not declared in this scope
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp: In member function 'void IRrecv::resume()':
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:332: error: 'volatile struct irparams_t' has no member named 'rcvstate'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:333: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp: In member function 'int IRrecv::decode(decode_results*)':
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:343: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:344: error: 'volatile struct irparams_t' has no member named 'rcvstate'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp: In member function 'long int IRrecv::decodeNEC(decode_results*)':
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:392: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:400: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp: In member function 'long int IRrecv::decodeSony(decode_results*)':
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:433: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:443: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp: In member function 'long int IRrecv::decodeRC5(decode_results*)':
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:518: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Users\Niels\Documents\Arduino\libraries\IRremote\IRremote.cpp:529: error: 'volatile struct irparams_t' has no member named 'rawlen'


Am I not including the library files right? Or am I doing something else wrong?
Is there an easier way for me to know which button on the remote sends me what code?


Thanks in advance,

NielsH
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I suspect your running arduino IDE version 1.0 or newer and that library is compatible with only IDEs prior to version 1.0.

 Lots of 3rd party contributed librares have not been tweaked to run with the newer IDE. So research on what it takes to fix the older library or seek out a newer version or a different librry that does work with the newer IDEs. Or download an older arduino IDE say version 22 and see if the library works with it.

Lefty
Logged

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

Ok, I'll try that and see if it works.. Thanks
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 617
Posts: 49455
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

IRremoteInt.h contains an include statement that tries to include WProgram.h. Change that to Arduino.h, and your problems will go away.
Logged

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

IRremoteInt.h contains an include statement that tries to include WProgram.h. Change that to Arduino.h, and your problems will go away.

I've tried this, I still seem to get the same errors... So i guess I'll continue looking for newer versions of the program/libraries
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 617
Posts: 49455
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I've tried this, I still seem to get the same errors
Then, I'm sorry, but you did something wrong. That was all I needed to do do to make the code compile.

Do you have more than one copy of the IRRemote library?
Logged

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

I've found an updated version of the same library, and it seems to work now...
(though I can't remember where I found it)

Thanks for the help,

NielsH
Logged

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

i write core for IRrec . can't compile
the code is
#include <IRremote.h>
#include <IRremoteInt.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
  }
}
##########################################
but can't compile cos error
the error
c:/program files/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld.exe: sketch_mar29a.cpp.elf section .text will not fit in region text
c:/program files/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld.exe: region text overflowed by 50 bytes
###########################################
can you solution this error for me .

Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 617
Posts: 49455
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
can you solution this error for me .
Did you really have the UNO selected in the Tools menu?

When I do, with your code, I get this "error":
Quote
Binary sketch size: 6,246 bytes (of a 32,256 byte maximum)
Logged

Pages: [1]   Go Up
Jump to: