NRF24 Sending multiple different variables

im trying to use a nrf24 card to send some data and the data will be floats/ints/unsigned longs. for example

int var1 = 2222
float var2 = 19.99
unsigned long var3 = 9999999

i dont use data structures very often and now im thinking this may be the only way to go. some type of array?
not sure what to do ive looked at a lot of different sample code but none of them really seem to lean towards what im going for. whats the easiest way to approach this? im using the RF24 library and nRF24L01

heres some clips of sample code ive thrown together trying to figure something out. trying to send theData structure throws compiler error "no matching function for call to 'RF24::write(Payload*)'"

// SimpleTx - the master or the transmitter

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


#define CE_PIN   9
#define CSN_PIN 10

const byte slaveAddress[5] = {'R','x','A','A','A'};


RF24 radio(CE_PIN, CSN_PIN); // Create a Radio

char dataToSend[10] = "message0";
char txNum = '0';
unsigned long var = 100012;

unsigned long currentMillis;
unsigned long prevMillis;
unsigned long txIntervalMillis = 1000; // send once per second

byte sendSize=0;
typedef struct {
  int           nodeId; //store this nodeId
  unsigned long uptime; //uptime in ms
  float         temp;   //temperature maybe?
} Payload;
Payload theData;

void setup() {

    Serial.begin(9600);

    Serial.println("SimpleTx Starting");

    radio.begin();
    radio.setDataRate( RF24_250KBPS );
    radio.setRetries(3,5); // delay, count
    radio.openWritingPipe(slaveAddress);
}

//====================

void loop() {
    currentMillis = millis();
    if (currentMillis - prevMillis >= txIntervalMillis) {
        send();
        prevMillis = millis();
    }
}

//====================

void send() {

    bool rslt;
    rslt = radio.write(&theData), sizeof(theData));
        // Always use sizeof() as it gives the size as the number of bytes.
        // For example if dataToSend was an int sizeof() would correctly return 2

    Serial.print("Data Sent ");
    Serial.print(dataToSend);
    if (rslt) {
        Serial.println("  Acknowledge received");
        updateMessage();
    }
    else {
        Serial.println("  Tx failed");
    }
}

//================

void updateMessage() {
        // so you can see that new data is being sent
    txNum += 1;
    if (txNum > '9') {
        txNum = '0';
    }
    dataToSend[8] = txNum;
}

and here is some sample code for another type of rf card i was trying to learn from the way the structure in this code was setup

i have new code that puts the float "temp" into a array and the receiving code is displaying the correct data but how can i send temp and humidity at the same time?

// SimpleTx - the master or the transmitter

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


#define CE_PIN   9
#define CSN_PIN 10



float temp = 76.00;
float humidity = 49.01;
int examplestate = 4;
unsigned long currentRunMillis = 12345678;



const byte slaveAddress[5] = {'R','x','A','A','A'};


RF24 radio(CE_PIN, CSN_PIN); // Create a Radio


unsigned long currentMillis;
unsigned long prevMillis;
unsigned long txIntervalMillis = 1000; // send once per second


void setup() {

    Serial.begin(9600);
    Serial.println("SimpleTx Starting");
    radio.begin();
    radio.setDataRate( RF24_250KBPS );
    radio.setRetries(3,5); // delay, count
    radio.openWritingPipe(slaveAddress);
}

//====================

void loop() {
    currentMillis = millis();
    if (currentMillis - prevMillis >= txIntervalMillis) {
        send();
        prevMillis = millis();
    }
}

//====================

void send() {

    bool rslt;
      char buf2[16];
      dtostrf(temp, 0, 2, buf2);
    rslt = radio.write( &buf2, sizeof(buf2));
        // Always use sizeof() as it gives the size as the number of bytes.


    
}

some one please help me figure out how to turn this array back into individual variables my code send a array of float variables but i need to compare these variables on the receive side and so ar all i can get is the same variable printed 4 times.

sending code \

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

const int pinCE = 9;
const int pinCSN = 10;


float temp = 1.11;
float humidity = 99.9999;
int interger = 30001;
unsigned long marker = 0;

RF24 wirelessSPI(pinCE, pinCSN);
const uint64_t pAddress = 0xB00B1E5000LL;

void setup()
{
  Serial.begin(9600);
  wirelessSPI.begin();
  wirelessSPI.setAutoAck(1);
  wirelessSPI.enableAckPayload();
  wirelessSPI.setRetries(5, 15);
  wirelessSPI.openWritingPipe(pAddress);
  wirelessSPI.stopListening();
  wirelessSPI.printDetails();
}

void loop()
{
  
  float Array[2] = {temp, humidity};
  Array[1] = interger;
  

 if (millis() - marker > 999){
  if (!wirelessSPI.write( &Array, sizeof(Array))) {
    Serial.println("delivery failed");
    Serial.println();
  }
  else {
    Serial.println("Send successful.");
    Serial.println();
  }
  marker = millis();
  temp = temp + 50;
  humidity ++;
 }
}

receiving code \\

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

const int pinCE = 9; 
const int pinCSN = 10; 
float gotArray[32]; 
unsigned long marker = 0;



RF24 wirelessSPI(pinCE, pinCSN);  
const uint64_t pAddress = 0xB00B1E5000LL;  

void setup()   
{
 Serial.begin(9600);  
 wirelessSPI.begin();  
 wirelessSPI.setAutoAck(1);             
 wirelessSPI.enableAckPayload();        
 wirelessSPI.setRetries(5,15);        
 wirelessSPI.openReadingPipe(1,pAddress);   
 wirelessSPI.startListening();      
 wirelessSPI.printDetails();     
}

void loop()  
{   
  while(wirelessSPI.available()){ 
    if (millis() - marker > 999){
    wirelessSPI.read( &gotArray, sizeof(gotArray) ); 
    Serial.println("Recieved array:"); 
   for (byte i=0; i<4; i++){
  
   // Serial.println(gotArray[x]);

    
    String myString = String(gotArray[i]);
      Serial.println(myString);
    }
    marker = millis();
    Serial.println();
   
    }
  }
 //delay(100);    
}

idk if its the right way but i found A way to make it work and be able to compare the data

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

const int pinCE = 9; 
const int pinCSN = 10; 
float gotArray[32]; 
unsigned long marker = 0;



RF24 wirelessSPI(pinCE, pinCSN);  
const uint64_t pAddress = 0xB00B1E5000LL;  

void setup()   
{
 Serial.begin(9600);  
 wirelessSPI.begin();  
 wirelessSPI.setAutoAck(1);             
 wirelessSPI.enableAckPayload();        
 wirelessSPI.setRetries(5,15);        
 wirelessSPI.openReadingPipe(1,pAddress);   
 wirelessSPI.startListening();      
 wirelessSPI.printDetails();     
}

void loop()  
{   
  while(wirelessSPI.available()){ 
    if (millis() - marker > 100){
    wirelessSPI.read( &gotArray, sizeof(gotArray) ); 
    Serial.println("Recieved array:"); 
   for (byte i=0; i<8; i++){
 // Serial.println(myString);
    Serial.println(gotArray[i]);

    }
     for (byte x=0; x<1; x++){
       String myString = String(gotArray[x]);
      Serial.println(myString);
    marker = millis();
    Serial.println();
     }
         for (byte x=1; x<2; x++){
       String myString = String(gotArray[x]);
      Serial.println(myString);
    marker = millis();
    Serial.println();
     if (myString == "30001.00") {
      Serial.println("it worked");
    //  digitalWrite(3, HIGH);
     }
     }
     }
    
  }
 //delay(100);    
}

Please just make one Post and wait for an answer to that question before posting another Reply. It makes it much easier to help.

If you want to send a mix of variable types then just create a struct and send that.

You can create a struct like this (taken from something I am working on)

struct TrainMoveStruct {
	byte curPos;
	char moveState; // S tarting   M oving   L dr triggered   D one
	unsigned long startMillis;
};

TrainMoveStruct trainMove;

Add values to the struct like this

trainMove.moveState = 'M';

and then you can send it with

radio.write(&trainMove,  sizeof(trainMove));

Have the same struct on the receiving side

...R