Hi
I’m working on a project with the XA1110 GPS on an arduino, and I’m having some troubles when I try to implement the test-code in my main. The test code (see below), works perfect and the GPS gets a GPS fix in no time. The first line in the loop prints the number of new available bytes from the GPS module - and this seems to be around 240 - 250 bytes.
#include <SparkFun_I2C_GPS_Arduino_Library.h>
I2CGPS myI2CGPS;
void setup(){
myI2CGPS.begin(); // initializing I2C communication
}
void loop(){
Serial.println(myI2CGPS.available());
while (myI2CGPS.available()) //available() returns the number of new bytes available from the GPS module
{
gps.encode(myI2CGPS.read()); //Feed the GPS parser
}
lat = gps.location.lat();
lon = gps.location.lng();
SIV = gps.satellites.value();
Serial.println(lat,5);
Serial.println(lon,5);
Serial.println(SIV);
}
When I implement the exact same code in my main code the first line in the loop only gives me 40-50 available bytes and it takes much longer to obtain a gps fix. It also seems like there is fewer satelites in view although all physical conditions are kept constant.
The main code also contains three other I2C components (Blue Robotics bar30, BR celsius fast-response and atlas Conductivity K 1.0 Kit).
I have been working on this for days now, and I can’t figure out what i’m doing wrong!