I am trying to send GPS data via the NRF24L01 module. I have perfectly working GPS code that accurately gives me the data I want, and I have perfectly working RF code which transmits data to my receiver. However, when I put both modules together, the GPS stops working. If I comment out the line "radio.write(&gps_data, sizeof(gps_data))" my GPS starts printing data to the serial port again. If I uncomment the line, my GPS only prints zeroes to the serial port. I have gone through and debugged every line of the code, and have found that the only thing that stops the GPS working is having this line of code at the end of my loop. Images Capture and Capture 1 display the working GPS without the line, and images Capture2 and Capture 4 display the GPS not working when the line is included in code. All these images are attached to this post.
I have included my code as well. Note I am using .CPP and .H files, so my GPS functions are in the GPS.cpp file. This code works perfectly and returns accurate data. I used the Adafruit ultimate GPS library. I am using an NR24L01 module and an Adafruit Ultimate breakout GPS, all running on a Teensy 4.0.
GPS TX is connected to Teensy RX (Pin0) AND gps rx is connected to Teensy TX (pin 1).
GPS.cpp (5.11 KB)
GPS.h (138 Bytes)
GPS_Testing.ino (1.28 KB)