ARDUINO+GPS+NRF24L01

Hi all bro and sis,i’m making a project that transmit gps data through NRF24L01 to another arduino.But below code did’t work.What’s wrong in my code please help me.thank u all

#include <TinyGPS++.h>
#include <SoftwareSerial.h>
#include <RF24Network.h>
#include <RF24.h>
#include <SPI.h>

static const int RXPin = 2, TXPin = 3;
static const uint32_t GPSBaud = 9600;
SoftwareSerial sGPS(RXPin, TXPin);

TinyGPSPlus gps;

double myLL[2];
// nRF24L01(+) radio attached (CE, CSN)
RF24 radio(9,10);

RF24Network network(radio);
// Channel of our node
const uint16_t channel = 60;
// Address of our node
const uint16_t this_node = 1;
// Address of the base
const uint16_t other_node = 0;

// How many packets have we sent already
unsigned long packets_sent;

// Structure of our payload, limited to 32 bytes
struct payload_t // 32 bytes max
{
unsigned long counter; // 4 bytes
double lat; // 4 bytes
double lng; // 4 bytes

};

void getGPS(); // get GPS data
static void smartDelay(unsigned long); // ensures that the gps object is being “fed”.
void getVoltage(); // getVoltage
void sendPayload(); // check if time to send payload

void setup(void)
{
sGPS.begin(GPSBaud);
Serial.begin(115200);
SPI.begin();
radio.begin();
network.begin(channel, this_node);
radio.powerDown();
}

void loop(void){

network.update();
while (sGPS.available() > 0){
if (gps.encode(sGPS.read())){
getGPS();
sendPayload();
smartDelay(2000);
}
}
}
void getGPS(){
if (gps.location.isValid()){
myLL[0] = gps.location.lat();
myLL[1] = gps.location.lng();
Serial.print("lat: ");
Serial.println(myLL[0],7);
Serial.print("lng: ");
Serial.println(myLL[1],7);

}
}
void sendPayload(){
payload_t payload = { packets_sent++, myLL[0], myLL[1]};
RF24NetworkHeader header(other_node);
radio.powerUp();
delay(1);
bool ok = network.write(header,&payload,sizeof(payload));
radio.powerDown();

}
static void smartDelay(unsigned long ms){
unsigned long start = millis();
do
{
while (sGPS.available())
gps.encode(sGPS.read());
} while (millis() - start < ms);
}

Have a look at this Simple nRF24L01+ Tutorial

Get the wireless communications working before you start adding in other features.

...R

i'll try .thank u