Sending text variable with NRF24L01

I'm working on a sip and puff controller for an RC boat using 2 Unos. I had troubles with getting the NRF24L01 communications working a month or so ago but that is now working.

When I sip or puff on a tube the serial monitor shows me that I am going forward, idle or reverse, right now I'm just trying to get this part working. I want to send that variable's text to the receiving Uno. These are the two variables used:

enum DRIVE_STATE {FORWARD, REVERSE, IDLE}; // Enumeration, FORWARD - 1, REVERSE = 2, IDLE = 3
char *DRIVE_STATE_STRS[] = {"forward", "reverse", "idle"}; // ? Defines words so that when Drive state = 1 Serial monitor will display Forward, etc

I added this commands to send the text"

   char text[20];
   text[]= DRIVE_STATE_STRS[driveState];
   radio.write(&text, sizeof(text));

I get the following error
"expected primary-expression before ']' token"

How do I format that variable so I can send the drive status to the receiving Uno?

Here is the complete code

/* Started with sipPuffToyCar_Mod example
 *  added NRF24L01 communications
 */

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

RF24 radio(7, 8); // CE, CSN

const byte address[6] = "00001";

#define ThrottleTrimInput A2
#define SteeringTrimInput A3
#define SENSOR_PIN A5
#define ThrottleOutput 5
#define SteeringOutput 6
#define FORWARD_PIN 7
#define REVERSE_PIN 8
#define LEFT_PIN 9
#define RIGHT_PIN 10

#define SIP_THRESHOLD 450 //analog val
#define PUFF_THRESHOLD 550 //analog val

#define POLL_INTERVAL 10 //ms

#define SHORT_ACTION_MIN 100 //ms
#define SHORT_ACTION_MAX 750 //ms
#define ACTION_SPACE_MIN 50 //ms
#define ACTION_SPACE_MAX 750 //ms

uint32_t sipStartTime;
uint8_t sipStarted = 0;
uint32_t lastSipTime;
uint32_t lastSipDuration;

uint32_t puffStartTime;
uint8_t puffStarted = 0;
uint32_t lastPuffTime;
uint32_t lastPuffDuration;

uint8_t ThrottleOutValue = 0;
uint8_t ThrottleTrimValue = 0;
uint8_t SteeringOutValue = 135;
uint8_t SteeringTrimValue = 0;

uint32_t SteeringDelay = 0;
uint32_t previousMillis = 0;
uint32_t StartSteeringDelay = 50;
uint8_t SteeringPause = 0;
uint32_t SteeringPauseDelay = 1000;
uint32_t SteeringPauseStart = 0;

enum DRIVE_STATE {FORWARD, REVERSE, IDLE}; // Enumeration, FORWARD - 1, REVERSE = 2, IDLE = 3
char *DRIVE_STATE_STRS[] = {"forward", "reverse", "idle"}; // ? Defines words so that when Drive state = 1 Serial monitor will display Forward, etc
uint8_t driveState = IDLE;




//
void setDrive(uint8_t state)
{

 pinMode(FORWARD_PIN, OUTPUT);
 pinMode(REVERSE_PIN, OUTPUT);

	if (driveState == state)
		return;

	if (state == FORWARD)
	{
      digitalWrite(FORWARD_PIN, HIGH);
  
      Serial.print (" Forward Pause = ");
      Serial.print (SteeringPause);
      Serial.print (" Time =  ");
      Serial.println (SteeringPauseStart);
  }
	else if (state == REVERSE)
	{
      digitalWrite (REVERSE_PIN, HIGH);
 
      Serial.print (" Reverse Pause = ");
      Serial.print (SteeringPause);
      Serial.print (" Time =  ");
      Serial.println (SteeringPauseStart);
	}
	else
	{
      digitalWrite (FORWARD_PIN, LOW);
      digitalWrite (REVERSE_PIN, LOW);  
	}
	
	driveState = state;
}

//
void toggleReverse()
{
	if (driveState == REVERSE)
		return;

    else if (driveState == IDLE)
            setDrive(REVERSE);
    	else
		
		setDrive(IDLE);
}

//
void toggleForward()
{
	if (driveState == FORWARD)
	 return;

    else if (driveState == IDLE)
            setDrive(FORWARD);
    
    else

    setDrive(IDLE);
   
}

enum STEERING_STATE {LEFT, RIGHT, CENTER};
char *STEERING_STATE_STRS[] = {"left", "right", "center"};
uint8_t steeringState = CENTER;

//
void setSteering(uint8_t state)

{

   pinMode(LEFT_PIN, OUTPUT);
   pinMode(RIGHT_PIN, OUTPUT);
 
	if (steeringState == state)
		return;

	if (state == LEFT)

  //  && (millis() - SteeringPauseStart) > SteeringPauseDelay // This line was added to the If condition statement above
  
	{
      Serial.print (" Left Pause = ");
      Serial.print (SteeringPause);
      Serial.print ("Pause Time =  ");
      Serial.println (millis() - SteeringPauseStart);
         
	    digitalWrite(LEFT_PIN, HIGH);
	
		}
	else if (state == RIGHT)

  //  && (millis() - SteeringPauseStart) > SteeringPauseDelay // This line was added to the If condition statement above
  
	{

      Serial.print (" Right Pause = ");
      Serial.print (SteeringPause);
      Serial.print (" Pause Time =  ");
      Serial.println (millis() - SteeringPauseStart);
     
	    digitalWrite(RIGHT_PIN, HIGH);
	
	
	}
	else
	{
	 digitalWrite(LEFT_PIN, LOW);
	 digitalWrite(RIGHT_PIN, LOW);
   SteeringPauseStart = millis();
   SteeringPause = 0;

   Serial.print (" Idle Pause = ");
   Serial.print (SteeringPause);
   Serial.print (" Pause Time =  ");
   Serial.println (millis() - SteeringPauseStart);
   
	}
	
	steeringState = state;
} // end void setSteering(uint8_t state)

//
void setup()
{
	Serial.begin(9600);
  radio.begin();
  radio.setDataRate(RF24_1MBPS); //added to original example
  radio.setChannel(96);  //added to original example
  radio.setPALevel(RF24_PA_MIN);
  radio.openWritingPipe(address);
  radio.stopListening();
  
	while (1) // Constantly run While Loop
	{
		int16_t val = analogRead(SENSOR_PIN); // Read Pressure Switch < 450 = SIP, > 550 = Puff

    if (!sipStarted && val < SIP_THRESHOLD)
		{
      SteeringPause = 1;
      sipStarted = 1;
			sipStartTime = millis(); //Store Sip Start Time
  	}
		else if (sipStarted && val > SIP_THRESHOLD) // SIP has Stopped
		{
			sipStarted = 0;
			uint32_t duration = millis() - sipStartTime;
			if (duration > SHORT_ACTION_MIN)
			{
				uint32_t prevLastSipTime = lastSipTime;
				uint32_t prevLastSipDuration = lastSipDuration;
				
				lastSipTime = millis();
				lastSipDuration = duration;
				
				uint32_t space = sipStartTime - prevLastSipTime;

				//two shorts in a row
				if (prevLastSipDuration < SHORT_ACTION_MAX &&
					lastSipDuration < SHORT_ACTION_MAX &&
					space > ACTION_SPACE_MIN && space < ACTION_SPACE_MAX)
					{
						toggleReverse();
          }
      }
    }
    
		
		if (!puffStarted && val > PUFF_THRESHOLD)
		{
      SteeringPause = 1;
      puffStarted = 1;
			puffStartTime = millis();
  	}
		else if (puffStarted && val < PUFF_THRESHOLD)
		{
			puffStarted = 0;
			uint32_t duration = millis() - puffStartTime;
			if (duration > SHORT_ACTION_MIN)
			{
				uint32_t prevLastPuffTime = lastPuffTime;
				uint32_t prevLastPuffDuration = lastPuffDuration;
				
				lastPuffTime = millis();
				lastPuffDuration = duration;
				
				uint32_t space = puffStartTime - prevLastPuffTime;
				
				//two shorts in a row
				if (prevLastPuffDuration < SHORT_ACTION_MAX &&
					lastPuffDuration < SHORT_ACTION_MAX &&
					space > ACTION_SPACE_MIN && space < ACTION_SPACE_MAX)
					{
						toggleForward();
					}
			}
  }
	
		//update steering
       
		if (sipStarted)
			setSteering(LEFT);
		else if (puffStarted)
			setSteering(RIGHT);
    else
			setSteering(CENTER);
		
  // Set Throttle Output with Trim

  ThrottleTrimValue = map(analogRead(ThrottleTrimInput), 0, 1024, 85, 135) - 110;
  
        if(DRIVE_STATE_STRS[driveState]== "forward") {
            ThrottleOutValue = (240 - ThrottleTrimValue) ;
            analogWrite(ThrottleOutput, ThrottleOutValue);
          //  Serial.print("  Throttle Out = ");
         //   Serial.print(ThrottleOutValue);
                                          }
        else if (DRIVE_STATE_STRS[driveState]== "reverse") {
            ThrottleOutValue = (30  - ThrottleTrimValue);
            analogWrite(ThrottleOutput, ThrottleOutValue);
         //   Serial.print("  Throttle Out = ");
         //   Serial.print(ThrottleOutValue);
                                          }
        else{
             ThrottleOutValue = (135  - ThrottleTrimValue);
             analogWrite(ThrottleOutput, ThrottleOutValue);
         //    Serial.print("  Throttle Out = ");
        //     Serial.print(ThrottleOutValue);
                                         }
  // Set Steeering Output with Trim

  SteeringTrimValue = map(analogRead(SteeringTrimInput), 0, 1024, 85, 135) - 110;

     // Delay for Steering change
        
        unsigned long currentmillis = millis();
        int CenterStop ;

       
               
   if (currentmillis - previousMillis > StartSteeringDelay){
           
       previousMillis = currentmillis;
       CenterStop = (135 + SteeringTrimValue);
       
            if((STEERING_STATE_STRS[steeringState]== "right")&& (SteeringOutValue < 230)) {
              
                SteeringOutValue = ((SteeringOutValue + 10) );
                analogWrite(SteeringOutput, SteeringOutValue);
                                                                                          }
                if ((STEERING_STATE_STRS[steeringState]== "left") && (SteeringOutValue > 40)) {
                  
                    SteeringOutValue = ((SteeringOutValue - 10)  );
                    analogWrite(SteeringOutput, SteeringOutValue);
                                                               }
                      if (STEERING_STATE_STRS[steeringState]== "center"){

                        if (SteeringOutValue - CenterStop > 2) {
                         
                              SteeringOutValue = ((SteeringOutValue) - 5);
                              analogWrite(SteeringOutput, SteeringOutValue);
                                                                  }
                                                    
                         if (SteeringOutValue - CenterStop < -2){
                         
                                SteeringOutValue = ((SteeringOutValue) + 5);
                                analogWrite(SteeringOutput, SteeringOutValue);
                                                                  }      
                                                                             } // End of CENTER if
          
    } // End of Main Steering If loop
            
   
                                     
	 Serial.print("  drive: ");		
	 Serial.println(DRIVE_STATE_STRS[driveState]);	
   char text[20];
   text[]= DRIVE_STATE_STRS[driveState];
   radio.write(&text, sizeof(text));
   
	
	//	Serial.print("  Throttle Out =" );
 //   Serial.print(ThrottleOutValue);
 //   Serial.print("  Throttle Trim =" );
 //   Serial.print(ThrottleTrimValue);
    
 // 	Serial.print("   Steering Out ");	
 //   Serial.print (SteeringOutValue);
 //   Serial.print("  Steering Trim =" );
  //  Serial.print(SteeringTrimValue);
    
 //   Serial.print(" CenterStop = " );
 //   Serial.println(CenterStop);
//    Serial.print ("  Steering - Center =  ");
 //   Serial.print(SteeringOutValue - CenterStop);
      Serial.print("  Steering State =  ");    
      Serial.println(STEERING_STATE_STRS[steeringState]);
 //     Serial.print("  Drive State =  ");    
 //     Serial.println(DRIVE_STATE_STRS[driveState]);
 

		delay(POLL_INTERVAL);

 // if (sipStarted == 1){
//    Serial.println ("Sip Started");
 //   StartSteeringDelay = 0;
 // }
  //    else if (puffStarted ==1){
  //    Serial.println ("Puff Started");
//    }
 //   else {}
 //     }
 
	} // End of While;
} // End ot Setup Loop




//
void loop() {}

Thanks
John

Send predefined size packets. You can add a CRC or checksum to the packet for error checking.

Easiest way would be to send a single byte with different values
and then do a similar thing on the receiverside as you do on the sender-side

If you still prefer sending strings
me personal I use SafeStrings as they offer almost the same comfort as Strings
but are safe to use. (in opposite to using Strings which IS dangerous

Why do you establisch a while (1)-loop inside setup() ?
function loop() is made for exactly this:

loop infinitely

You have a strange way of formatting your code.
I reformatted to be closer to the standard.
There are two "standards" opening curly brace in the same line as code or below
me personal I prefer same line
If you install the SafeString-library from the library-manager
this code-version compiles

/* Started with sipPuffToyCar_Mod example
    added NRF24L01 communications
*/

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <SafeString.h>

cSF(myText_SS, 24);
RF24 radio(7, 8); // CE, CSN

const byte address[6] = "00001";

#define ThrottleTrimInput A2
#define SteeringTrimInput A3
#define SENSOR_PIN A5
#define ThrottleOutput 5
#define SteeringOutput 6
#define FORWARD_PIN 7
#define REVERSE_PIN 8
#define LEFT_PIN 9
#define RIGHT_PIN 10

#define SIP_THRESHOLD 450 //analog val
#define PUFF_THRESHOLD 550 //analog val

#define POLL_INTERVAL 10 //ms

#define SHORT_ACTION_MIN 100 //ms
#define SHORT_ACTION_MAX 750 //ms
#define ACTION_SPACE_MIN 50 //ms
#define ACTION_SPACE_MAX 750 //ms

uint32_t sipStartTime;
uint8_t sipStarted = 0;
uint32_t lastSipTime;
uint32_t lastSipDuration;

uint32_t puffStartTime;
uint8_t puffStarted = 0;
uint32_t lastPuffTime;
uint32_t lastPuffDuration;

uint8_t ThrottleOutValue = 0;
uint8_t ThrottleTrimValue = 0;
uint8_t SteeringOutValue = 135;
uint8_t SteeringTrimValue = 0;

uint32_t SteeringDelay = 0;
uint32_t previousMillis = 0;
uint32_t StartSteeringDelay = 50;
uint8_t SteeringPause = 0;
uint32_t SteeringPauseDelay = 1000;
uint32_t SteeringPauseStart = 0;

enum DRIVE_STATE {FORWARD, REVERSE, IDLE}; // Enumeration, FORWARD - 1, REVERSE = 2, IDLE = 3
char *DRIVE_STATE_STRS[] = {"forward", "reverse", "idle"}; // ? Defines words so that when Drive state = 1 Serial monitor will display Forward, etc
uint8_t driveState = IDLE;


//
void setDrive(uint8_t state) {
  pinMode(FORWARD_PIN, OUTPUT);
  pinMode(REVERSE_PIN, OUTPUT);

  if (driveState == state)
    return;

  if (state == FORWARD) {
    digitalWrite(FORWARD_PIN, HIGH);

    Serial.print (" Forward Pause = ");
    Serial.print (SteeringPause);
    Serial.print (" Time =  ");
    Serial.println (SteeringPauseStart);
  }
  else if (state == REVERSE) {
    digitalWrite (REVERSE_PIN, HIGH);

    Serial.print (" Reverse Pause = ");
    Serial.print (SteeringPause);
    Serial.print (" Time =  ");
    Serial.println (SteeringPauseStart);
  }
  else {
    digitalWrite (FORWARD_PIN, LOW);
    digitalWrite (REVERSE_PIN, LOW);
  }
  driveState = state;
}

//
void toggleReverse() {
  if (driveState == REVERSE)
    return;

  else if (driveState == IDLE)
    setDrive(REVERSE);
  else
    setDrive(IDLE);
}


void toggleForward() {
  if (driveState == FORWARD)
    return;

  else if (driveState == IDLE)
    setDrive(FORWARD);
  else
    setDrive(IDLE);
}

enum STEERING_STATE {LEFT, RIGHT, CENTER};
char *STEERING_STATE_STRS[] = {"left", "right", "center"};
uint8_t steeringState = CENTER;

void setSteering(uint8_t state) {

  pinMode(LEFT_PIN, OUTPUT);
  pinMode(RIGHT_PIN, OUTPUT);

  if (steeringState == state)
    return;

  if (state == LEFT) {
    //  && (millis() - SteeringPauseStart) > SteeringPauseDelay
    // This line was added to the If condition statement above
    Serial.print (" Left Pause = ");
    Serial.print (SteeringPause);
    Serial.print ("Pause Time =  ");
    Serial.println (millis() - SteeringPauseStart);

    digitalWrite(LEFT_PIN, HIGH);
  }
  else if (state == RIGHT) {
    //  && (millis() - SteeringPauseStart) > SteeringPauseDelay
    // This line was added to the If condition statement above
    Serial.print (" Right Pause = ");
    Serial.print (SteeringPause);
    Serial.print (" Pause Time =  ");
    Serial.println (millis() - SteeringPauseStart);

    digitalWrite(RIGHT_PIN, HIGH);
  }
  else {
    digitalWrite(LEFT_PIN, LOW);
    digitalWrite(RIGHT_PIN, LOW);
    SteeringPauseStart = millis();
    SteeringPause = 0;

    Serial.print (" Idle Pause = ");
    Serial.print (SteeringPause);
    Serial.print (" Pause Time =  ");
    Serial.println (millis() - SteeringPauseStart);
  }
  steeringState = state;
} // end void setSteering(uint8_t state)


void setup() {
  Serial.begin(9600);
  radio.begin();
  radio.setDataRate(RF24_1MBPS); //added to original example
  radio.setChannel(96);  //added to original example
  radio.setPALevel(RF24_PA_MIN);
  radio.openWritingPipe(address);
  radio.stopListening();
} // End ot Setup Loop


void loop() {
  // loop is doing this Constantly repeating
  // while (1) { // Constantly run While Loop

  int16_t val = analogRead(SENSOR_PIN); // Read Pressure Switch < 450 = SIP, > 550 = Puff

  if (!sipStarted && val < SIP_THRESHOLD) {
    SteeringPause = 1;
    sipStarted = 1;
    sipStartTime = millis(); //Store Sip Start Time
  }
  else if (sipStarted && val > SIP_THRESHOLD) {// SIP has Stopped
    sipStarted = 0;
    uint32_t duration = millis() - sipStartTime;

    if (duration > SHORT_ACTION_MIN) {
      uint32_t prevLastSipTime = lastSipTime;
      uint32_t prevLastSipDuration = lastSipDuration;

      lastSipTime = millis();
      lastSipDuration = duration;

      uint32_t space = sipStartTime - prevLastSipTime;

      //two shorts in a row
      if (prevLastSipDuration < SHORT_ACTION_MAX &&
          lastSipDuration < SHORT_ACTION_MAX &&
          space > ACTION_SPACE_MIN && space < ACTION_SPACE_MAX) {
        toggleReverse();
      }
    }
  }

  if (!puffStarted && val > PUFF_THRESHOLD) {
    SteeringPause = 1;
    puffStarted = 1;
    puffStartTime = millis();
  }
  else if (puffStarted && val < PUFF_THRESHOLD) {
    puffStarted = 0;
    uint32_t duration = millis() - puffStartTime;
    if (duration > SHORT_ACTION_MIN) {
      uint32_t prevLastPuffTime = lastPuffTime;
      uint32_t prevLastPuffDuration = lastPuffDuration;

      lastPuffTime = millis();
      lastPuffDuration = duration;

      uint32_t space = puffStartTime - prevLastPuffTime;

      //two shorts in a row
      if (prevLastPuffDuration < SHORT_ACTION_MAX &&
          lastPuffDuration < SHORT_ACTION_MAX &&
          space > ACTION_SPACE_MIN && space < ACTION_SPACE_MAX) {
        toggleForward();
      }
    }
  }

  //update steering
  if (sipStarted)
    setSteering(LEFT);
  else if (puffStarted)
    setSteering(RIGHT);
  else
    setSteering(CENTER);

  // Set Throttle Output with Trim

  ThrottleTrimValue = map(analogRead(ThrottleTrimInput), 0, 1024, 85, 135) - 110;

  if (DRIVE_STATE_STRS[driveState] == "forward") {
    ThrottleOutValue = (240 - ThrottleTrimValue) ;
    analogWrite(ThrottleOutput, ThrottleOutValue);
    //  Serial.print("  Throttle Out = ");
    //   Serial.print(ThrottleOutValue);
  }
  else if (DRIVE_STATE_STRS[driveState] == "reverse") {
    ThrottleOutValue = (30  - ThrottleTrimValue);
    analogWrite(ThrottleOutput, ThrottleOutValue);
    //   Serial.print("  Throttle Out = ");
    //   Serial.print(ThrottleOutValue);
  }
  else {
    ThrottleOutValue = (135  - ThrottleTrimValue);
    analogWrite(ThrottleOutput, ThrottleOutValue);
    //    Serial.print("  Throttle Out = ");
    //     Serial.print(ThrottleOutValue);
  }
  // Set Steeering Output with Trim

  SteeringTrimValue = map(analogRead(SteeringTrimInput), 0, 1024, 85, 135) - 110;

  // Delay for Steering change

  unsigned long currentmillis = millis();
  int CenterStop ;

  if (currentmillis - previousMillis > StartSteeringDelay) {
    previousMillis = currentmillis;
    CenterStop = (135 + SteeringTrimValue);

    if ((STEERING_STATE_STRS[steeringState] == "right") && (SteeringOutValue < 230)) {

      SteeringOutValue = ((SteeringOutValue + 10) );
      analogWrite(SteeringOutput, SteeringOutValue);
    }

    if ((STEERING_STATE_STRS[steeringState] == "left") && (SteeringOutValue > 40)) {
      SteeringOutValue = ((SteeringOutValue - 10)  );
      analogWrite(SteeringOutput, SteeringOutValue);
    }

    if (STEERING_STATE_STRS[steeringState] == "center") {
      if (SteeringOutValue - CenterStop > 2) {
        SteeringOutValue = ((SteeringOutValue) - 5);
        analogWrite(SteeringOutput, SteeringOutValue);
      }

      if (SteeringOutValue - CenterStop < -2) {
        SteeringOutValue = ((SteeringOutValue) + 5);
        analogWrite(SteeringOutput, SteeringOutValue);
      }
    } // End of CENTER if
  } // End of Main Steering If loop

  Serial.print("  drive: ");
  Serial.println(DRIVE_STATE_STRS[driveState]);
  //char text[20];
  //text[]= DRIVE_STATE_STRS[driveState];
  //radio.write(&text, sizeof(text));
  myText_SS = DRIVE_STATE_STRS[driveState];
  radio.write(myText_SS.c_str(), myText_SS.length() );

  //  Serial.print("  Throttle Out =" );
  //   Serial.print(ThrottleOutValue);
  //   Serial.print("  Throttle Trim =" );
  //   Serial.print(ThrottleTrimValue);

  //   Serial.print("   Steering Out ");
  //   Serial.print (SteeringOutValue);
  //   Serial.print("  Steering Trim =" );
  //  Serial.print(SteeringTrimValue);

  //   Serial.print(" CenterStop = " );
  //   Serial.println(CenterStop);
  //    Serial.print ("  Steering - Center =  ");
  //   Serial.print(SteeringOutValue - CenterStop);
  Serial.print("  Steering State =  ");
  Serial.println(STEERING_STATE_STRS[steeringState]);
  //     Serial.print("  Drive State =  ");
  //     Serial.println(DRIVE_STATE_STRS[driveState]);

  delay(POLL_INTERVAL);

  // if (sipStarted == 1){
  //    Serial.println ("Sip Started");
  //   StartSteeringDelay = 0;
  // }
  //    else if (puffStarted ==1){
  //    Serial.println ("Puff Started");
  //    }
  //   else {}
  //     }
}

best regards Stefan

Hello Stumpy_L

For a long time I have been following the topic with the use of this type of wireless module and the associated software functions.

For wireless projects I recommend the use of the HC12 module.

What are the advantages:

  1. no external functions from a library are needed.
  2. the development of a communication protocol is in your hands
  3. the necessary development steps can be programmed and tested without using the wireless module
  4. the radio module can be easily configured for the project requirements
  5. both transmitter and receiver are contained in one radio module.

hth

Have a nice day and enjoy coding in C++.

@StefanL38 Awesome! that works great. I did think about sending 1, 2, 3 instead of the text and I may still, might be easier to interpret on the receiver side. I found this code online a few years ago, I reference that in the heading, I also questioned about using the while loop instead of loop but it worked so I left it as is. I started to work on this project again recently and wanted to update the code. I got a good part of it done but had one problem so I loaded this one back up to see what he did differently and said "Why reinvent the wheel, it works" I think you are correct and I should redo it properly. Thanks so much for your help.

@gilshultz obviously I'm not real versed in this part of coding so I don't know how to do what you suggest but it's good research, and homework, for me. Thanks

@paulpaulson I have looked into using the HC12 modules and think they are a good option and will also do some homework on those. On the other hand I had a bunch of the NRF24L01's in a draw and have used them before so I am somewhat familiar with them, so again I went with them, thanks

It is sort of like swimming, once you learn you do not forget for a long time. Look at it this way each stroke the more you know the closer to the end you will be and the easier the next stroke.

@gilshultz so true, I try to find the answers myself when I have a problem, Arduino reference, YouTube, other examples I find on line and review them, try this, try that, but when I still can't get it to work I ask on the forum and always get great responses. That's how you learn and grow. Thanks again