user57281: I have a 433Mhz Superheterodyne receiver and a hand set remote of similar frequency, I'm using the RC-Switch library and I couldn't find a better way than using the "numbers" that I'm receiving like this:

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

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

void loop() {
  if (mySwitch.getReceivedValue() == 7264305) {
    digitalWrite(13, LOW);
  }
  if (mySwitch.getReceivedValue() == 7264308) {
    digitalWrite(13, HIGH);
  }
  if (mySwitch.getReceivedValue() == 7264306) {
    mySwitch.resetAvailable();
  }
}

Is there any other (better?) way than just using the "numbers" simply like that or everyone are using their remote commands like I'm using?

user31105: Credits for this answer are mainly for jsotola (see his remarks above). But I want to show an alternative to the if statements, and a way to get the last 4 bits:

In case you want to check for the least significant bits, use ((mySwitch.getReceivedValue() & 0xFFFFF0)
TO check for the least significant four bits (the data you want to act upon), use ((mySwitch.getReceivedValue() & 0xF)
Use a switch statement instead of the if statement; also in theory (I don't know the code of mySwitch.getReceivedValue() does not need to be executed multiple times.

So you get something like this:
void loop() 
{
  unsigned long receivedValue = mySwitch.getReceivedValue(); // Call function only once

  if ((receivedValue & 0xFFFF0) == 0x6ED830)
  {
    // Process action
    switch (receivedValue & 0xF)
    {
    case 0x5:
      digitalWrite(13, LOW);
      break;

    case 0x8:
      digitalWrite(13, HIGH);
      break;

    case 0x6:
      mySwitch.resetAvailable();
      break;

    default: // All other values
      break; // Ignore
  }
}


57281: <p>I have a <a href="https://www.aliexpress.com/item/Wholesale-433-Mhz-Superheterodyne-RF-Receiver-and-Transmitter-Module-ASK-kits-with-antenna-For-Arduino-Diy/32799575156.html" rel="nofollow noreferrer">433Mhz Superheterodyne receiver</a> and a hand set remote of similar frequency, I'm using the <a href="https://github.com/sui77/rc-switch" rel="nofollow noreferrer">RC-Switch library</a> and I couldn't find a better way than using the "numbers" that I'm receiving like this:
</p>

<pre class="lang-cpp prettyprint-override"><code>#include &lt;RCSwitch.h&gt;

RCSwitch mySwitch = RCSwitch();

void setup() {
  Serial.begin(9600);
  mySwitch.enableReceive(0);  // Receiver on interrupt 0 =&gt; that is pin #2
  pinMode(13, OUTPUT);
}

void loop() {
  if (mySwitch.getReceivedValue() == 7264305) {
    digitalWrite(13, LOW);
  }
  if (mySwitch.getReceivedValue() == 7264308) {
    digitalWrite(13, HIGH);
  }
  if (mySwitch.getReceivedValue() == 7264306) {
    mySwitch.resetAvailable();
  }
}
</code></pre>

<p>Is there any other (better?) way than just using the "numbers" simply like that or everyone are using their remote commands like I'm using?</p>
 31105: <p>Credits for this answer are mainly for jsotola (see his remarks above). But I want to show an alternative to the <code>if</code> statements, and a way to get the last 4 bits:</p>

<ol>
<li>In case you want to check for the least significant bits, use <code>((mySwitch.getReceivedValue() &amp; 0xFFFFF0)</code></li>
<li>TO check for the least significant four bits (the data you want to act upon), use <code>((mySwitch.getReceivedValue() &amp; 0xF)</code></li>
<li>Use a switch statement instead of the <code>if</code> statement; also in theory (I don't know the code of <code>mySwitch.getReceivedValue()</code> does not need to be executed multiple times.</li>
</ol>

<p>So you get something like this:</p>

<pre><code>void loop() 
{
  unsigned long receivedValue = mySwitch.getReceivedValue(); // Call function only once

  if ((receivedValue &amp; 0xFFFF0) == 0x6ED830)
  {
    // Process action
    switch (receivedValue &amp; 0xF)
    {
    case 0x5:
      digitalWrite(13, LOW);
      break;

    case 0x8:
      digitalWrite(13, HIGH);
      break;

    case 0x6:
      mySwitch.resetAvailable();
      break;

    default: // All other values
      break; // Ignore
  }
}
</code></pre>
