@Robin2 yes I saw how you did it with letters. I tried to change your simple tx code so it can send a struct data type and got this. It works and sends but the receiver only gets "0.0"
Here is the code I altered.
#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'}; // address for master to slave communication
RF24 radio(CE_PIN, CSN_PIN); // Create a Radio
typedef struct {
char dataToSend[10] = "Hello";
int A = 47;
} data;
data payload;
unsigned long currentMillis; //Millis = Time that has passed since running code
unsigned long prevMillis;
unsigned long txIntervalMillis = 1000; // send once per second
void setup() {
Serial.begin(9600); //Ensure the baurd rate is the same in the reciever
Serial.println("SimpleTx Starting");
radio.begin(); //opening channel
radio.setDataRate( RF24_250KBPS ); //setting bandwidth to 250kBps
radio.setRetries(3,5); // delay, count
radio.openWritingPipe(slaveAddress); //setting the address for this pipe
}
//====================
void loop() {
currentMillis = millis();
if (currentMillis - prevMillis >= txIntervalMillis) {
send();
prevMillis = millis();
}
}
//====================
void send() {
bool rslt;
rslt = radio.write(&payload, sizeof(payload));
// 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 ");
if (rslt) {
Serial.println(" Acknowledge received");
}
else {
Serial.println(" Tx failed");
}
}