SDA and SCL refer to an I2C interface for which A4 and A5 are the corresponding pins on a Nano but does the module use an I2C interface ?
If it uses a serial interface then when comminicating with a Nano it is usual to use SoftwareSerial so that you can choose the Tx and Rx pins and leave hardware Serial (pins 0 and 1) for debugging
UKHeliBob:
SDA and SCL refer to an I2C interface for which A4 and A5 are the corresponding pins on a Nano but does the module use an I2C interface ?
...........................
I have no idea about that and I have been able to find out by doing a quick search.
I may not have explained my dilemma properly: The GPS unit output pins are designated tx & rx.
I don't know if they correspond to A4 & A5 respectively, or the other way around.
Then it is a serial device. Use SoftwareSerial and designate your own Tx and Rx pins on the Arduino. By all means use A4 and A5 if you want, but don't forget to cross connect Tx on the GPS to your chosen Rx pin on the Arduino and vice versa
It can be as simple as (untested)
#include <SoftwareSerial.h>
SoftwareSerial gps(7, 8); //Rx Tx - choose any pins except 0 and 1
void setup()
{
Serial.begin(115200);
gps.begin(9600); //baud rate for GPS may need to be changed
}
void loop()
{
if (gps.available())
{
// Serial.print(gps.read()); //see next reply
Serial.write(gps.read());
}
}
UKHeliBob:
Then it is a serial device. Use SoftwareSerial and designate your own Tx and Rx pins on the Arduino. ...................
Thanks again Bob.
However, I have no idea what "SoftwareSerial" is, I am only a raw beginner to arduino.
I am making up another openXsensor using mstrens code and instructions, the basic section is here on GitHub:
Am I to assume that I need to edit this to include some (or all of) your code additions above?
Don't include it anywhere. It is a complete sketch. Copy it to the IDE, connect the GPS to the Tx and Rx pins and power. Upload the sketch to the Arduino and open the Serial monitor. Once the GPS has a fix on the satellites, which may not be possible indoors, you should see the GPS data on the Serial monitor