Skip to content

GPS Neo 6M

javierre edited this page May 13, 2019 · 3 revisions

GPS Neo-6M

GPS6MV2

Es importante observar que los pines Tx y Rx se conectan cruzados en nuestra placa NodeMCU, es decir, el pin que termine en Tx del GPS será para nuestro NodeMCU el Rx y viceversa.

GPS6MV2


/*
 * Rui Santos 
 * Complete Project Details http://randomnerdtutorials.com
 */
 
#include <TinyGPS++.h>
#include <SoftwareSerial.h>

static const int RXPin = D6, TXPin = D5;
static const uint32_t GPSBaud = 9600;

// The TinyGPS++ object
TinyGPSPlus gps;

// The serial connection to the GPS device
SoftwareSerial ss(RXPin, TXPin);

void setup(){
  Serial.begin(9600);
  ss.begin(GPSBaud);
}

void loop(){
  // This sketch displays information every time a new sentence is correctly encoded.
  //Serial.println("hh");
  while (ss.available() > 0){
    gps.encode(ss.read());
    if (gps.location.isUpdated()){
      Serial.print("Latitude= "); 
      Serial.print(gps.location.lat(), 6);
      Serial.print(" Longitude= "); 
      Serial.println(gps.location.lng(), 6);
    }
  }
}


GPS6MV2

Códigos de ejemplo longitud, latitud

Códigos de ejemplo datos

Clone this wiki locally