Hi guys, I keep on running into a problem when trying to display longitude and latitude on the serial monitor using the Ublox NEO6MV2 GPS Aircraft Flight Controller module. I use the TinyGPS library btw (credit to Mikal Hart). Here is the code I use (just for testing purposes):
#include <SoftwareSerial.h>
#include "TinyGPS.h"
TinyGPS gps;
SoftwareSerial mySerial(10, 11);
void setup() {
Serial.begin(9600);
mySerial.begin(9600);
}
void loop() {
while (mySerial.available()) {
int c = mySerial.read();
gps.encode(c);
}
long latitude, longitude;
gps.get_position(&latitude, &longitude, NULL);
Serial.print("Latitude: ");
Serial.println(latitude);
Serial.print("Longitude: ");
Serial.println(longitude);
delay(500);
}
I keep on getting longitude and latitude as 999999999. I have been googling for hours and have tried changing the baude rates, using the TX/RX pins of the Arduino, etc. and have yet to get anywhere. Am I suppose to configure the Ublox GPS first using the u-center?
Thank you to all who post.
Edit - pins that I am using:
RX pin of GPS to digital pin 10 of arduino
TX pin of GPS to digital pin 11 of arduino
VCC of GPS to 3.3 V pin of arduino
GND to GND