Unable to control RGB LED strip with RF transmitter

Hi all,

I’m pretty new to coding and photon-arduino applications but I’m a quick learner (or so I think). Hopefully this is the right forum area to post this.

I’m trying to write up a code that allows me to control cheap RGB LED with my voice through Amazon Echo and IFTTT. My code doesn’t work for some reason and I’m not sure what I’m doing wrong.

For some background, I’m using tutorials in the following links and trying to combine sections of the codes to make it work for my situation.


I was able to successfully replicate infrared application (first tutorial below) but I have interference issues from other remotes, so I decided to give radio frequency a try. I recorded the RF signatures of certain light functions and was able to use an Arduino Uno to figure out signal delays. But when I plug these information into the code below, I can’t control the lights with my voice.

 int rfTransmitPin = D4;  //RF Transmitter pin = digital pin 4
 int ledPin = D7;        //Onboard LED = digital pin 7



 const int codeSize = 25;      //The size of the code to transmit
 int codeToTransmit[codeSize]; //The array used to hold the RF code

 int lightON[]={4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,2,2,2,2,4,3}; //The RF code that will turn the light ON
 int lightOFF[]={4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,2,2,2,2,4,3}; //The RF code that will turn the light OFF
 int red[]={4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,4,2,2,2,2,3}; //The RF code that will turn the light red 
 int green[]={4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,4,2,2,4,2,2}; //The RF code that will turn the light green
 int blue[]={2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,4,2,2,2,4,3,4}; //The RF code that will turn the light blue
 int mode[]={4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,2,2,4,2,4,3}; //The RF code that will cycle modes
 int brighter[]={4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,2,4,4,2,2,2}; //The RF code that will increase brightness
 int dimmer[]={4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,2,4,4,4,4,3}; //The RF code that will decrease brightness
 int calibratorDelay=140;      // Calibrated for RF signal lengths.

 int controlRGB(String command); // String will be provided by voice commands through Amazon Echo and IFTTT recipe



 void setup(){
     pinMode(rfTransmitPin, OUTPUT);   //Transmit pin is an output  
     pinMode(ledPin, OUTPUT);   //I'm using on-board LED signal to make sure my voice is translated into string 
     Particle.function("lights", controlRGB);

 }

  int controlRGB(String command){

    if(command == "onoff"){
        codeToTransmit[codeSize]=lightON[codeSize];
        transmitCode();
    }
    if(command == "red"){
        codeToTransmit[codeSize]=red[codeSize];
        transmitCode();
    }
    if(command == "green"){
       codeToTransmit[codeSize]=green[codeSize];
       transmitCode();
    }
    if(command == "blue"){
        codeToTransmit[codeSize]=blue[codeSize];
        transmitCode();  
    }
    if(command == "mode"){
        codeToTransmit[codeSize]=mode[codeSize];
        transmitCode();
    }
    if(command == "brighter"){
        codeToTransmit[codeSize]=brighter[codeSize];
        transmitCode();
    }
    if(command == "dimmer"){
        codeToTransmit[codeSize]=dimmer[codeSize];
        transmitCode();
    }

}

 void transmitCode(){
    // The LED will be turned on to create a visual signal transmission indicator.
    digitalWrite(ledPin, HIGH);
    delay(1000);

   //initialise the variables 
    int highLength = 0;
    int lowLength = 0;

    //The signal is transmitted 6 times in succession      
    for(int j = 0; j<6; j++){
      for(int i = 0; i<codeSize; i++){ 
        switch(codeToTransmit[i]){
          case 2: // SH + LL (indicates Short HIGH and Long LOW signal)
            highLength=3;  //These values were registered by testing the actual remote control with a RF receiver circuit
            lowLength=10;
          break;
          case 3: // SL + VLL (indicates Short HIGH and Very Long LOW signal)
            highLength=3;
            lowLength=108;
          break;
          case 4: // LH + SL (indicates Long HIGH and Short LOW signal)
            highLength=10;
            lowLength=3;
          break;

        }

         /* Transmit a HIGH signal - the duration of transmission will be determined 
            by the highLength and timeDelay variables */
         digitalWrite(rfTransmitPin, HIGH);     
         delay(highLength*calibratorDelay); 

         /* Transmit a LOW signal - the duration of transmission will be determined 
            by the lowLength and timeDelay variables */
         digitalWrite(rfTransmitPin,LOW);     
         delay(lowLength*calibratorDelay);  
      }
    }
    //Turn the LED off after the code has been transmitted.
    digitalWrite(ledPin, LOW); 
  }

I see the on board LED firing after correct voice commands but I can’t detect transmission of RF signal (as evidenced by no color change in LED strip and also by using an Arduino board attached to receiver).

Any help is greatly appreciated!

Are you meaning to copy the entire lightON array to the codeToTransmit array with this command?

You should learn about how to properly copy an array using a for loop or standard C functions like memcpy.

1 Like

Your int controlRGB(String command) should also have a return someValue; instruction.

And instead of copying strings around you may rather want to consider something like void transmitCode(const char* code, int len) { ... } and call that like transmitCode(lightON, codeSize);

2 Likes

Thank you for your quick responses!

I read up on this usage and tried few different ways but I don’t think I’m writing it correctly. Can you let me know what kind of a return Value I should define and how to modify transmitCode block accordingly?

If you can point me to a resource, I’d like to learn more about this.

Thank you very much

I’d do things like this

int controlRGB(String command){
    if(command.equalsIgnoreCase("onoff")) {
       return transmitCode(lightON, codeSize);
    }
    else if(command.equalsIgnoreCase("red")) {
       return transmitCode(red, codeSize);
    }
    ...
 
    return -1;
}

int transmitCode(const char* code, int len) {
  int retVal = -1; // this should be reflect some status of your code execution/success/fail story

  // do your stuff with code[] while manipulating retVal in a meaningful way

  return retVal;
}

To me, it would be easier copying a pointer to the command (array). A lot of beginners struggle with pointers, but you can try to look at this (not great) example of how to do that (works for your fixed-width arrays):

int lightON[] =  {4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,2,2,2,2,4,3}; //The RF code that will turn the light ON
int lightOFF[] = {4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,2,2,2,2,4,3}; //The RF code that will turn the light OFF
int red[] =      {4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,4,2,2,2,2,3}; //The RF code that will turn the light red 
int green[] =    {4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,4,2,2,4,2,2}; //The RF code that will turn the light green
int blue[] =     {2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,4,2,2,2,4,3,4}; //The RF code that will turn the light blue
int mode[] =     {4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,2,2,4,2,4,3}; //The RF code that will cycle modes
int brighter[] = {4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,2,4,4,2,2,2}; //The RF code that will increase brightness
int dimmer[] =   {4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,2,4,4,4,4,3}; //The RF code that will decrease brightness

int* arrayPtr;

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

void loop() 
{
  if(Serial.available())
  {
    char myChar = Serial.read();
    sendCommand(myChar);
  }
}

void sendCommand(char command)
{
  switch (command)
  {
    case '1':
      arrayPtr = lightON;
      break;
    case '2':
      arrayPtr = lightOFF;
      break;
    case '3':
      arrayPtr = red;
      break;
    case '4':
      arrayPtr = green;
      break;
    case '5':
      arrayPtr = blue;
      break;
    case '6':
      arrayPtr = brighter;
      break;
    case '7':
      arrayPtr = dimmer;
      break;
    default:
      return;
  }
  for(int i = 0; i < 25; i++)
  {
    Serial.println(arrayPtr[i]);
  }
}

PS all of your commands (since they won’t change) should be declared const like this:

const int lightON[] =  {4,2,4,2,2,4,4,4,2,2,...

@BulldogLowell, I’m not quite sure what the benefit of copying the pointer over my propsed code is.

Granted, I haven’t noticed that code arrays are typed int. I just assumed from the code they were char[].
But to be honest, I would change that anyway from int[] to uint8_t[] (which is pretty much the same as char[]) and that way my proposed function would just look like this

const uint8_t lightON[] =  {4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,2,2,2,2,4,3};
...

int transmitCode(const uint8_t* code, int len)

and when we are going for numbers instead of names, I’d even go a step further and create a two dimensional array and just pass the number of the code to the active function (or save that number to a global and let loop() call the function)
Like so

enum CODES 
{ lightON  = 1
, lightOFF = 2
, red      = 3 
, green    = 4
, blue     = 5
, mode     = 6
, brighter = 7
, dimmer   = 8
, minCode  = lightOn
, maxCode  = dimmer  
};

const uint8_t codes[][codeSize] = 
{ {4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,2,2,2,2,4,3}
, {4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,2,2,2,2,4,3}
, {4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,4,2,2,2,2,3}
, {4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,4,2,2,4,2,2}
, {2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,4,2,2,2,4,3,4}
, {4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,2,2,4,2,4,3}
, {4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,2,4,4,2,2,2}
, {4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,2,4,4,4,4,3}
};

int controlRGB(String command){
  return transmitCode((CODES)command.toInt());
}

int transmitCode(CODES codeNumber) {
  if (codeNumber < minCode || maxCode < codeNumber) return -1;

  // do your stuff with codes[codeNumber] 

  return codeNumber;
}

I never said it was better! Plus, frankly I didn’t even read what you wrote. :wink:

I merely wrote a demonstration (and… commented “not great”) showing how to copy a pointer and then I forgot all about it!

I figured if the OP couldn’t copy an array, well there is a steep curve from there (no offense meant towards @codelicious :slight_smile: ).

Thanks @BulldogLowell, I just thought this …

… was refering to what I had proposed.
My bad (again) :blush:
I’m still thinking too linearly in todays hyperlinked world :sunglasses:

1 Like

The function definitely needs to be called in loop(). I timed out calling the function with “onoff”, and it took 6 minutes! A bit long for a Particle.function return :wink:

1 Like

Hi,

Sorry I’ve been busy and didn’t have much time trying your proposed codes. I couldn’t figure out mainly the following details:

  1. How to write in the delay times of each signal to be sent.
  2. How to define that the RF signature will be sent 6 times.
  3. How to define lengths of LOW and HIGH signal separately (every instance of transmission has two distinct signal components)

In the first version of the code I wrote these was taken care of under transmitCode() section. With your codes I don’t know how it would fit in. Any ideas?

My suggestions didn’t alter anything on the internal logic of transmitCode() so that should still work the same way as before.
Although using non-blocking approach would always be best.

If you don’t mind, can you copy paste what would be the complete code?

At the risk of sounding like a complete idiot, I’m continuously getting various errors ranging from syntax errors to definition errors.

Thank you very much in advance!

I’d rather try to educate you to solve these errors than just spoon feeding you a solution :wink:
If you post your current code and the error messages, we can work on this together.

I appreciate your input. The thing is, my complete beginner level knowledge doesn’t allow me to figure out how this code blocks should talk to each other and carry out functions (especially your part where you talked about retval and where you modified controlRGB and transmitCode parts). So when I get error messages it doesn’t make sense why I’m getting these and also how to solve these.

Anyways, I copy pasted your part, and by trial and error approach --with not much intellectual steering-- I ended up with this:

     int rfTransmitPin = D4;  //RF Transmitter pin = digital pin 4
     int ledPin = D7;        //Onboard LED = digital pin 7
    
     const int codeSize = 25;      //The size of the code to transmit
     int codetoTransmit[codeSize]; //The array used to hold the RF code
    
     const uint8_t lightON[]={4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,2,2,2,2,4,3}; //The RF code that will turn the light ON
     const uint8_t lightOFF[]={4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,2,2,2,2,4,3}; //The RF code that will turn the light OFF
     const uint8_t red[]={4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,4,2,2,2,2,3}; //The RF code that will turn the light red 
     const uint8_t green[]={4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,4,2,2,4,2,2}; //The RF code that will turn the light green
     const uint8_t blue[]={2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,4,2,2,2,4,3,4}; //The RF code that will turn the light blue
     const uint8_t mode[]={4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,2,2,4,2,4,3}; //The RF code that will cycle modes
     const uint8_t brighter[]={4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,2,4,4,2,2,2}; //The RF code that will increase brightness
     const uint8_t dimmer[]={4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,2,4,4,4,4,3}; //The RF code that will decrease brightness
     const uint8_t calibratorDelay=140;      // Calibrated for RF signal lengths.
    
    
     int controlRGB(String command); // String will be provided by voice commands through Amazon Echo and IFTTT recipe
    
     int controlRGB(String command){
        if(command.equalsIgnoreCase("onoff")) {
           return transmitCode(lightON, codeSize);
        }
        else if(command.equalsIgnoreCase("red")) {
           return transmitCode(red, codeSize);                  // Will add more here after test run
        }
        
        return -1;
    }
    
    int transmitCode(const uint8_t* codetoTransmit, int codeSize) {
      int retVal = -1; // this should be reflect some status of your code execution/success/fail story
    
                                  // do your stuff with code[] while manipulating retVal in a meaningful way
    
      return retVal;
    }
    
    void setup(){
         pinMode(rfTransmitPin, OUTPUT);   //Transmit pin is an output  
         pinMode(ledPin, OUTPUT);   //I'm using on-board LED signal to make sure my voice is translated into string 
         Particle.function("lights", controlRGB);
    
     }
    
    
      void transmitCode(){
        // The LED will be turned on to create a visual signal transmission indicator.
        digitalWrite(ledPin, HIGH);
        delay(1000);
    
       //initialise the variables 
        int highLength = 0;
        int lowLength = 0;
    
        //The signal is transmitted 6 times in succession      
        for(int j = 0; j<6; j++){
          for(int i = 0; i<codeSize; i++){ 
            switch(codeToTransmit){
              case 2: // SH + LL (indicates Short HIGH and Long LOW signal)
                highLength=3;  //These values were registered by testing the actual remote control with a RF receiver circuit
                lowLength=10;
              break;
              case 3: // SL + VLL (indicates Short HIGH and Very Long LOW signal)
                highLength=3;
                lowLength=108;
              break;
              case 4: // LH + SL (indicates Long HIGH and Short LOW signal)
                highLength=10;
                lowLength=3;
              break;
    
            }
    
             /* Transmit a HIGH signal - the duration of transmission will be determined 
                by the highLength and timeDelay variables */
             digitalWrite(rfTransmitPin, HIGH);     
             delay(highLength*calibratorDelay); 
    
             /* Transmit a LOW signal - the duration of transmission will be determined 
                by the lowLength and timeDelay variables */
             digitalWrite(rfTransmitPin,LOW);     
             delay(lowLength*calibratorDelay);  
          }
        }
        //Turn the LED off after the code has been transmitted.
        digitalWrite(ledPin, LOW); 
    
      }

This is the error message I get:

    rf_led_scruffr.cpp:59:16: error: 'codeToTransmit' was not declared in this scope
     int highLength = 0;

When I tried different things I get about a million different type of errors and weirdly, the errors pop up in earlier lines when I change something in the bottom seemingly unrelated to these.

In essence I’m not understanding how the part you proposed is supposed to work… I have several questions to wrap my mind around this:

  1. Why do you need to return -1 outside of if statement under controlRGB
  2. What is retVal under transmit code (I don’t think we defined this in the beginning)
  3. How does parameters inside parentheses work in the context of transmitCode
  4. I’m not sure if I understand what you mean doing stuff with code[] while manipulating retVal in a meaningful way (not sure what this meaningful way is either)

There are several other questions in my mind but these are the most prominent ones. I really would like to understand more and so far doing things by example worked great. I played with bunch of example projects with arduino and photon and I can manage to understand how stuff is supposed to work in a correctly written code (even though I wouldn’t be able to come up with that myself). I think seeing more examples will help me think about the code in a correct way.

Sorry for the question bombardment and looking forward to hear from you. Thanks

First, you have codetoTransmit vs. codeToTransmit

    int codetoTransmit[codeSize];
    ...
    int transmitCode(const uint8_t* codetoTransmit, int codeSize) {
      int retVal = -1; // this should be reflect some status of your code execution/success/fail story
    
                                  // do your stuff with code[] while manipulating retVal in a meaningful way
    
      return retVal;
    }
  ...
      void transmitCode(){
        ...
            switch(codeToTransmit){
        ...
      }

C/C++ is case sensitive.

But the main point is that

                                  // do your stuff with code[] while manipulating retVal in a meaningful way

Was only a comment which should indicate that this would be the place where your active code from your own void transmitCode() should go but instead of using the global codeToTransmit you should use the parameter passed to the function - which should not be called the same as the global variable (unless you ditch the global).

For your questions

I quote myself on this

Since you declared the function as int fn() it has to return an integer in all possible code paths.
If your command is neither "onoff" nor "red" you still have to return an integer. Hence the statement.

That is a local variable declared inside the function

This is such a fundamental topic for programming that you should consider consulting a basic programming tutorial (the same goes for the global vs. local variable question).
http://www.c4learn.com/c-programming/c-function-parameter-passing/

Return values are meant to hand back some information to the calling code about what happened in side the called function. Did the action complete successfully, what did happen, …
That depends entirely on the functions tasks but a programmer should know what is meaningful for that task.
e.g. if you have a function that reads user input, a meaningful return value would be the number of received characters.

Rookie mistake eh!? Passing parameters makes more sense now. I modified the code a bit and came up with this:

     int rfTransmitPin = D4;  //RF Transmitter pin = digital pin 4
     int ledPin = D7;        //Onboard LED = digital pin 7
 
     const int codeSize = 25;      //The size of the code to transmit
    
     const uint8_t lightON[]={4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,2,2,2,2,4,3}; //The RF code that will turn the light ON
     const uint8_t lightOFF[]={4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,2,2,2,2,4,3}; //The RF code that will turn the light OFF
     const uint8_t red[]={4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,4,2,2,2,2,3}; //The RF code that will turn the light red 
     const uint8_t green[]={4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,4,2,2,4,2,2}; //The RF code that will turn the light green
     const uint8_t blue[]={2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,4,2,2,2,4,3,4}; //The RF code that will turn the light blue
     const uint8_t mode[]={4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,2,2,4,2,4,3}; //The RF code that will cycle modes
     const uint8_t brighter[]={4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,2,4,4,2,2,2}; //The RF code that will increase brightness
     const uint8_t dimmer[]={4,2,4,2,2,4,4,4,2,2,2,2,4,4,4,2,2,2,2,2,4,4,4,4,3}; //The RF code that will decrease brightness
     const int calibratorDelay=140;      // Calibrated for RF signal lengths.
    
    
     int controlRGB(String command); // String will be provided by voice commands through Amazon Echo and IFTTT recipe
     int controlRGB(String command){
        if(command.equalsIgnoreCase("onoff")) {
           return transmitCode(lightON, codeSize);
        }
        else if(command.equalsIgnoreCase("red")) {
           return transmitCode(red, codeSize);                  // Will add more here after test run
        }
        
        return -1;
    }
    
     void setup(){
         pinMode(rfTransmitPin, OUTPUT);   //Transmit pin is an output  
         pinMode(ledPin, OUTPUT);   //I'm using on-board LED signal to make sure my voice is translated into string 
         Particle.function("lights", controlRGB);
    
     }
    
    
    int transmitCode(const uint8_t* code, int len) {
      int retVal = -1; // this should be reflect some status of your code execution/success/fail story
    
            // The LED will be turned on to create a visual signal transmission indicator.
        digitalWrite(ledPin, HIGH);
        delay(1000);
    
       //initialise the variables 
        int highLength = 0;
        int lowLength = 0;
    
        //The signal is transmitted 6 times in succession      
        for(int j = 0; j<6; j++){
          for(int i = 0; i<len; i++){ 
            switch(code[i]){
              case 2: // SH + LL (indicates Short HIGH and Long LOW signal)
                highLength=3;  //These values were registered by testing the actual remote control with a RF receiver circuit
                lowLength=10;
              break;
              case 3: // SL + VLL (indicates Short HIGH and Very Long LOW signal)
                highLength=3;
                lowLength=108;
              break;
              case 4: // LH + SL (indicates Long HIGH and Short LOW signal)
                highLength=10;
                lowLength=3;
              break;
    
            }
    
             /* Transmit a HIGH signal - the duration of transmission will be determined 
                by the highLength and timeDelay variables */
             digitalWrite(rfTransmitPin, HIGH);     
             delay(highLength*calibratorDelay); 
    
             /* Transmit a LOW signal - the duration of transmission will be determined 
                by the lowLength and timeDelay variables */
             digitalWrite(rfTransmitPin,LOW);     
             delay(lowLength*calibratorDelay);  
          }
        }
        //Turn the LED off after the code has been transmitted.
        digitalWrite(ledPin, LOW);                        // do your stuff with code[] while manipulating retVal in a meaningful way
    
      return retVal;
    }

When I say a command (such as red or on-off), I see that on board LED turns on but RF signal isn’t transmitted (no color change is observed – and I couldn’t detect the signal reception with an arduino). Also, on-board LED stays on suggesting switch case part isn’t functioning properly?

Are there other mistakes in the last version of the code above?

Thanks so much for your help!

If you swap D4 & D7 you may see if you get a flicker on the D7 LED.
You could also use a visible light LED on D4.

Have you got the IR LED connected right? You usually can see the IR signal with a web or phone camera to check if it turns on at all.
Also what kind of receiver are you using? Not all receivers accept mere HIGH/LOW IR signals but want a modulated IR burst of a specific carrier frequency.

Did you wait long enough to see that the onboard LED would turn off? As I said above in my post, it takes approx. 6 minutes for the transmitCode function to complete. I don’t see any errors in your code with the way that function is turning rfTransmitPin on and off.

The method I’m trying to use isn’t IR. I made IR work previously for this application but there were interference from TV remote, so I decided to switch to radio frequency (RF).

The receiver I’m using is the following:

I used this receiver-transmitter kit to record and broadcast signals by using the tutorials that I posted in my first post.

Suggesting the transmitter are communicating with the receiver correctly, when I was following the tutorial to figure out signal delay, I was able to toggle the light on and off.

It looks like somehow the code doesn’t allow broadcasting the correct signal. I can’t detect the RF signatures when I use an arduino to listen.