Buenas, estoy intentando mostrar en un display LCD, las coordenadas GPS de un módulo GPS Ublox y un arduino UNO, pero no hay manera de que me muestre las coordenadas por el LCD.
El código es este:
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 6, 7);
//Librerias para GPS
#include <TinyGPS++.h>
#include <SoftwareSerial.h>
//Objeto GPS
TinyGPSPlus gps;
//Variables para guardar coordenadas GPS
float latitude, longitude;
//Variable para guardar el numero de satelites GPS
int sat;
//Variable para velocidad GPS
int vel;
//Software serial GPS. Pin 2 a TX del GPS. Pin 3 no es necesario conectarlo.
SoftwareSerial ss(2, 3);
void setup() {
//Init Serial GPS
ss.begin(9600);
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
}
void loop() {
//Lee los datos recibidos por el serial del GPS
while (ss.available() > 0) {
gps.encode(ss.read());
}
//Almacena datos GPS en variables
latitude = gps.location.lat();
longitude = gps.location.lng();
sat = gps.satellites.value();
vel = gps.speed.kmph();
//print coordenadas en el LCD
lcd.clear();
lcd.setCursor (0,0);
lcd.print ("Lat: ");
lcd.print (latitude, 5);
lcd.setCursor(0,1);
lcd.print ("Lon: ");
lcd.print (longitude, 5);
delay (2000);
}