Me he bajado unas librerías que están subida en un tutorial de squidbee en la web de libelium, que creo que está generado por un compañero vuestro David Cuartielles, lo que sucede es que da igual que código coloque este o el que está en ejemplos no me da una señal válida :S siempre me da el FIX = 0 que es no válido... Puede ser por el código??? Ya es que me hace dudar ya que incluso me he subido a mi azotea y no encuentro señal :S
#include "LB_GPS.h"
void setup(){
//setup for Serial port
Serial.begin(9600);
// print some info and ego boost
Serial.println(GPS.getLibVersion());
Serial.print("Setting up GPS...");
// GPS warm-up time
// command initializing the GPS, by default it is preconfigured to be the
// weather station at central Malmo, Sweden, April 8th, 2009, 6:56AM
// also it reads only GPGGA sentences if no other configurations are set
GPS.init();
// done!
Serial.println(" done!");
delay(1000);
}
void loop(){
// print the raw data string arriving from the GPS
GPS.getRaw(100);
// now the data is stored in the GPS.inBuffer string
// and we can just dump it to the serial port
char sz[2048];
sprintf(sz, "%s", GPS.inBuffer);
char latitud[128];
char longitud[128];
char coordenadasbuenas[128];
char numerosatelites[128];
char cadenafinal[1024];
int n = 0;
char *p = sz;
char *str;
while ((str = strtok_r(p, ",", &p)) != NULL){
if(n==2){
sprintf(latitud, "%s", str);
}
if(n==3){
sprintf(latitud, "%s;%s", latitud, str);
}
if(n==4){
sprintf(longitud, "%s", str);
}if(n==5){
sprintf(longitud, "%s;%s", longitud, str);
}
if(n==6){
sprintf(coordenadasbuenas, "%s", str);
}
if(n==7){
sprintf(numerosatelites, "%s", str);
}
n++;
}
if (strcmp(coordenadasbuenas, "1")==0){
sprintf(cadenafinal, "Las coordenadas son validas, satelites: %s, latitud: %s, longitud: %s", numerosatelites, latitud, longitud);
}else{
sprintf(cadenafinal, "Las coordenadas son invalidas");
}
Serial.println(cadenafinal);
delay(1000);
}