Request for member '' in '', which is of non-class type 'int'

So I started using Ir remotes and receiver's
and when I was writing my code i kept on getting this error message
"request for member 'resume' in 'Receive', which is of non-class type 'int' "
I've tried for hours to fix it but I can't

Here's my code tell me what I need to fix:

//code start//

#include <IRremote.h> //include the library
#define Button_1 0xFF6897
#define Button_2 0xFF9867
int Receive = 13; //initialize pin 13 as recevier pin.
uint32_t Previous;
decode_results results;

void setup() {
Serial.begin(9600);
IrReceiver.begin(Receive);
pinMode(12, OUTPUT);
}
void loop() {
if (IrReceiver.decode()) { //if we have received an IR signal

switch(results.value) {
case Button_1 : digitalWrite(12, HIGH); break;
case Button_2 : digitalWrite(12, LOW); break;

  } 

Serial.println (results.value, HEX); //display HEX results
Receive.resume; //next value
}
Previous=results.value;
}
//code end//

Maybe
Receive.resume();
works better.

it unfortunately did not work.

So what is the error message now?

it's still,
request for member 'resume' in 'Receive', which is of non-class type 'int'

IrReceiver.resume();

You are missing the 'r' of Receiver also, and the Ir...

Oops! My bad, it's still displaying the same error message.

I added information, try again with IrReceiver.resume();

What is the extra info?

Because now the error is:
conflicting declaration 'int IrReceiver'

Nope, you are doing something strange.

#include <IRremote.h>  //include the library
#define Button_1 0xFF6897
#define Button_2 0xFF9867
int Receive = 13;  //initialize pin 13 as recevier pin.
uint32_t Previous;
decode_results results;
void setup() {
  Serial.begin(9600);
  IrReceiver.begin(Receive);
  pinMode(12, OUTPUT);
}
void loop() {
  if (IrReceiver.decode()) {  //if we have received an IR signal
    switch (results.value) {
      case Button_1: digitalWrite(12, HIGH); break;
      case Button_2: digitalWrite(12, LOW); break;
    }
    Serial.println(results.value, HEX);  //display HEX results
    IrReceiver.resume();                 //next value
  }
  Previous = results.value;
}
Sketch uses 7506 bytes (24%) of program storage space. Maximum is 30720 bytes.
Global variables use 432 bytes (21%) of dynamic memory, leaving 1616 bytes for local variables. Maximum is 2048 bytes.

--------------------------
Compilation complete.

Now that does work. But, in Serial Monitor each button acts as 0.

I will try to fix it but if it does not work than I will report back in this forum.

Thanks!

I think this has to go before the IrReceiver.resume();

All values are still 0.
No error though.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.