Untitled

 avatar
unknown
c_cpp
2 years ago
509 B
5
Indexable
#include <TinyGPS++.h>
#include <SoftwareSerial.h>

static const int RXPin = 1, TXPin = 0;
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() {
  gps.encode(ss.read());
  Serial.println(gps.speed.kmph());
  Serial.println(gps.encode(ss.read()));
  delay(1000);
  }
  
  //myservo.write(gps.speed.kmph());
Editor is loading...
Leave a Comment