Difficulty having Arduino react to RF433 signal from a decoded remote

My apologies if I'm missing something obvious, but I am trying to work out how to have my Arduino respond to RF433 signals from a remote control.

I've successfully followed many tutorials that show me how to use the rc.switch library to decode the signal received from the remote, and then in turn use the RC.Switch library to SEND those codes FROM the Arduino.

However I still have these remotes left over, and want to configure other Arduinos to be able to respond to signals from them. I know I'm doing something wrong here by trying to capture the result of a function into a variable, and perhaps not converting the data types correctly.

Here's what I was trying to do (as a basic proof of concept), this code will not compile due to "C++ forbids comparison between pointer and integer [-fpermissive]".

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

// setup variables for our received data:
unsigned int decvalue();
int bitlength();

void setup() {
  Serial.begin(9600);
  mySwitch.enableReceive(0);  // Receiver on interrupt 0 => that is pin #2
}

void loop() {
  if (mySwitch.available()) 
  {
    output(mySwitch.getReceivedValue(), mySwitch.getReceivedBitlength(), mySwitch.getReceivedDelay(), mySwitch.getReceivedRawdata(),mySwitch.getReceivedProtocol());
    
    // debug recieved variables
    Serial.println(mySwitch.getReceivedValue());
    Serial.println(mySwitch.getReceivedBitlength());
    Serial.println(mySwitch.getReceivedDelay());
    
    // capture received values
    decvalue = mySwitch.getReceivedValue;
    bitlength =  mySwitch.getReceivedBitlength;
    
    mySwitch.resetAvailable();
    
 // do something with received values
    if ((decvalue == 3977006695) && (bitlength == 32))
    {
    Serial.print("Hello World!");
    }    
    
  }
}

What the heck is this?

unsigned int decvalue();
int bitlength();

ieee488:
What the heck is this?

unsigned int decvalue();

int bitlength();

I'm aware I've got something wrong here which is why I'm asking for help. These were novice attempts to declare variables that I would later store the returned code and bit length from the rc.switch library functions, and perform my 'if' comparisons on. The data types were derived from reading the Rc.switch library, as that's what they were declared as there.

 // do something with received values
    if ((decvalue == 3977006695) && (bitlength == 32))
    {
    Serial.print("Hello World!");
    }

What kind of remotes are you using?
The Rcswitch library will only read a remote which has a PT2262 or equivalent encoder chip in it.

dmworking247:
I'm aware I've got something wrong here which is why I'm asking for help. These were novice attempts to declare variables that I would later store the returned code and bit length from the rc.switch library functions, and perform my 'if' comparisons on. The data types were derived from reading the Rc.switch library, as that's what they were declared as there.

 // do something with received values

if ((decvalue == 3977006695) && (bitlength == 32))
   {
   Serial.print("Hello World!");
   }

Then you had better go read https://www.arduino.cc/en/Reference/VariableDeclaration

I don't understand why people think they can plow ahead without understanding the bare basics.

mauried:
What kind of remotes are you using?
The Rcswitch library will only read a remote which has a PT2262 or equivalent encoder chip in it.

Mauried,

It's an Arlec AC outlet switch. The RF remote control has a ht48r01t3 chip.

rf.switch successfully decodes button presses from the remote, sufficient to get this (from channel 1 - ON, for example).

Decimal: 182210369 (32Bit) Binary: 00001010110111000100111101000001 Tri-State: not applicable PulseLength: 261 microseconds Protocol: 1
Raw data: 8128,300,692,224,764,232,756,232,760,712,272,228,768,700,284,240,748,720,268,704,292,212,776,696,292,696,292,696,292,212,780,208,776,212,780,692,296,212,776,212,776,700,288,696,288,700,292,696,292,216,768,700,524,472,372,720,560,356,168,836,196,240,68,536,3116,

As I mentioned, I can use the RF.switch library and tutorials to SEND this from a transmitter unit and that works fine.

What I'm asking is how to use the RC Switch library (or alternative method?) to have the Arduino respond to receiving the above command (rather than just decoding it for the serial monitor, or using the decoded values in a outbound sketch.

Since the decoding sketch can read this data, I wouldn't have thought I have a hardware/library compatibility issue which should prevent me from having Arduino respond to a button push on the original remote.

Does that make more sense? Or do you believe this isn't possible with this chip?

ieee488:
Then you had better go read https://www.arduino.cc/en/Reference/VariableDeclaration

I don't understand why people think they can plow ahead without understanding the bare basics.

... and I don't understand why long term members of enthusiast communities become so jaded that they tar ever newcomer with the same brush, or resort to patronizing people seeking help because they're bored of "stupid" questions.

I understand what the data types are, and I am not simply 'plowing ahead'. I've successfully built reverse geocaching boxes with GPS-triggered servo locks, built bluetooth robots motor controlers, temperature and light sensors, distance & impact sensors, articulated arms & neck, animated facial expressions through LED matrix, etc... and numerous other projects from scratch, and I've done that through HUNDREDS of hours of reading, trial and error, and tutorials on individual component or libraries.

And yet, I'm still a self-confessed newcomer to the programming side, and occassionally I exhaust all other avenues trying to get something to work. So I come here to the official Arduino forums, try to find the appropriate section, and ask fellow enthusiasts for some advice. So far, of my 10-odd questions here, I've either been ignored or patronized (as above), which isn't constructive and doesn't help the next guy who comes along with a similar question either.

Back on the point, it wasn't the definition of the variables I was struggling with, it was that I'm aware it's clearly not as simple as taking the value from " mySwitch.getReceivedValue(); "as this is a library function that (when called at this part in the code) may no longer be receiving a value from the RF transmitter.

However, now I'm guessing as to what the problem is, which is exactly what the rules of this forum tell me not to do, so I started by trying to describe what I was trying to achieve.