IR sensor

#include <IRremote.h>
int receiver = 1;
IRrecv irrecv(receiver);
decode_results results;

void setup()
{
Serial.begin(9600);
irrecv.enableIRIn();
}
void loop()
{
if (IRrecv.decode(e results))
{
Serial.println(results.value, HEX);
irrecv.resume();
}

}

what is wrong??
why ide gives me this error: expected primary-expression before '.'token
please help me =)

You should post the whole error, which also says the "e" is a problem.

This line:

 if (IRrecv.decode(e results))

should probably say:

 if (irrecv.decode(&results))

The "e " should be an "&" and "IR" should be "ir"... it compiles ok for me with those changes.

HTH...

now the erroe is: expected unqualified-id before'if'...

now the erroe is: expected unqualified-id before'if'...

Well it compiles for me with the two changes I made....

Is that the whole error?- if not post the whole error.

Have a look at the line that gets highlighted, and there's also a line number in the error. Maybe you made a typo when you made the fixes, so post the code again.

error:
lettura_IR.ino: In function 'void loop()':
lettura_IR:13: error: expected primary-expression before '.' token
lettura_IR:13: error: 'e' was not declared in this scope

#include <IRremote.h>
int receiver = 1;
IRrecv irrecv(receiver);
decode_results results;

void setup()
{
Serial.begin(9600);
irrecv.enableIRIn();
}
void loop()
{
if (IRrecv.decode(e results))
{
Serial.println(results.value, HEX);
irrecv.resume();
}

}

lettura_IR:13: error: 'e' was not declared in this scope

That's the error I already told you about... thought you had fixed it already?

yes, and this is the results...

#include <IRremote.h>
int receiver = 1;
IRrecv irrecv(receiver);
decode_results results;

void setup()
{
Serial.begin(9600);
irrecv.enableIRIn();
}
void loop()
{
if (irrecv.decode(&results))
{
Serial.println(results.value, HEX);
irrecv.resume();
}

}

In file included from C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:13:
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote/IRremoteInt.h:87: error: 'uint8_t' does not name a type
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote/IRremoteInt.h:88: error: 'uint8_t' does not name a type
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote/IRremoteInt.h:89: error: 'uint8_t' does not name a type
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote/IRremoteInt.h:92: error: 'uint8_t' does not name a type
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp: In member function 'void IRsend::mark(int)':
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:173: error: 'delayMicroseconds' was not declared in this scope
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp: In member function 'void IRsend::space(int)':
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:181: error: 'delayMicroseconds' was not declared in this scope
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp: In member function 'void IRsend::enableIROut(int)':
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:200: error: 'OUTPUT' was not declared in this scope
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:200: error: 'pinMode' was not declared in this scope
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:201: error: 'LOW' was not declared in this scope
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:201: error: 'digitalWrite' was

not declared in this scope
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp: In constructor 'IRrecv::IRrecv(int)':
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:217: error: 'volatile struct irparams_t' has no member named 'recvpin'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:218: error: 'volatile struct irparams_t' has no member named 'blinkflag'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp: In member function 'void IRrecv::enableIRIn()':
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:241: error: 'volatile struct irparams_t' has no member named 'rcvstate'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:242: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:246: error: 'volatile struct irparams_t' has no member named 'recvpin'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:246: error: 'INPUT' was not declared in this scope
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:246: error: 'pinMode' was not declared in this scope
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp: In member function 'void IRrecv::blink13(int)':
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:252: error: 'volatile struct irparams_t' has no member named 'blinkflag'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:254: error: 'OUTPUT' was not declared in this scope
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:254: error: 'pinMode' was not declared in this scope
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp: In function 'void __vector_9()':
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:268: error: 'volatile struct irparams_t' has no member named 'recvpin'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:268: error: 'digitalRead' was not declared in this scope
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:271: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:273: error: 'volatile struct irparams_t' has no member named 'rcvstate'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:275: error: 'volatile struct irparams_t' has no member named 'rcvstate'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:284: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:285: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:287: error: 'volatile struct irparams_t' has no member named 'rcvstate'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:293: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:295: error: 'volatile struct irparams_t' has no member named 'rcvstate'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:300: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:302: error: 'volatile struct irparams_t' has no member named 'rcvstate'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:310: error: 'volatile struct irparams_t' has no member named 'rcvstate'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:321: error: 'volatile struct irparams_t' has no member named 'blinkflag'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:323: error: 'B00100000' was not declared in this scope
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:326: error: 'B11011111' was not declared in this scope
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp: In member function 'void IRrecv::resume()':
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:332: error: 'volatile struct irparams_t' has no member named 'rcvstate'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:333: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp: In member function 'int IRrecv::decode(decode_results*)':
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:343: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:344: error: 'volatile struct irparams_t' has no member named 'rcvstate'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp: In member function 'long int IRrecv::decodeNEC(decode_results*)':
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:392: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:400: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp: In member function 'long int IRrecv::decodeSony(decode_results*)':
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:433: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:443: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp: In member function 'long int IRrecv::decodeRC5(decode_results*)':
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:518: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Documents and Settings\lorenzo\Desktop\arduino-1.0.4\libraries\IRremote\IRremote.cpp:529: error: 'volatile struct irparams_t' has no member named 'rawlen'

LolloSR:

#include <IRremote.h>

int receiver = 1;
IRrecv irrecv(receiver);
decode_results results;

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn();
}

void loop()
{
  if (irrecv.decode(&results))
  {
    Serial.println(results.value, HEX);
    irrecv.resume();
  }
}

This also compiles fine for me so maybe you have an old version of the IRremote library (Download the latest version from here) or it's not installed correctly.

I had compiled it in 101 with no errors and I get similar (but not identical) errors to you when I compile in 104 without the IR library, so Riva's probably right, it's a library thing.

Edit.... when I copy the library from my 101 folder to 104, it compiles clean in 104, so yep, def seems a library related problem.

thanks!!