Attempting to Transmit BME280 Temperature Data using nRF24L01+ Transceiver

We are attempting to put a BME280 sensor on our drone to read temperature data. This is being paired with a nRF24L01+ Transceiver in order to communicate the data wirelessly. We are running into an issue when we upload the code, it just shows 32 as the temperature and doesn’t update on the serial monitor. Any suggestions?

SensorTransmitter2.ino (915 Bytes)

RECIEVERTEST2.ino (1.46 KB)

HELP

This is how you post code:

//Include Libraries
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <Wire.h>
#include "SparkFunBME280.h"

//create an RF24 object
RF24 radio(9, 10);  // CE, CSN
BME280 mySensor;
//address through which two modules communicate.
const byte address[6] = "00001";
float previousRemoteTemperature = 0.1;
float remoteTemperature = 0.0;

struct package
{
  float temperature;
};
typedef struct package Package;
Package data;

void setup(){
  while (!Serial);
    Serial.begin(9600);
  
  radio.begin();
  
  //set the address
  radio.openReadingPipe(0, address);
  
  //Set module as receiver
  radio.startListening();
}


void loop(void){
  checkForWirelessData();
  printRemoteTemperature();
}

void checkForWirelessData(){
  if ( radio.available())
  {
    while (radio.available())
    {
      radio.read( &data, sizeof(data) );
      remoteTemperature = data.temperature;
    }
    Serial.print("\nPackage:");
    Serial.print("\n");
    Serial.println(data.temperature);
  }
}

void printRemoteTemperature(){
  String temperature;
  if (remoteTemperature != previousRemoteTemperature)
  {
    if (remoteTemperature == 0.0) //We just booted up
    {
      temperature = "---";
    } else if (remoteTemperature >= 100)
    {
      temperature = String(remoteTemperature, 0);
    } else
    {
      temperature = String(remoteTemperature, 1);
    }
    previousRemoteTemperature = remoteTemperature;
  }
}
//Include Libraries
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <Wire.h>
#include "SparkFunBME280.h"

BME280 mySensor;
//create an RF24 object
RF24 radio(9, 10);  // CE, CSN
float BME280_Temp;
//address through which two modules communicate.
const byte address[6] = "00001";

struct package
{
  float temperature ;
};
typedef struct package Package;
Package data;

void setup()
{
  Serial.begin(9600);
  //also might be problem
  Wire.begin();
  
  radio.begin();
  
  //set the address
  radio.openWritingPipe(address);
  
  //Set module as transmitter
  radio.stopListening();
}
void loop()
{
  BME280_Temp = mySensor.readTempF();
  Serial.print("Temperature = ");
  Serial.print(mySensor.readTempF());
  readSensor();
  radio.write(&data, sizeof(data));
  
  delay(1000);
}
void readSensor()
{
  data.temperature = mySensor.readTempF();
}