Untitled

mail@pastecode.io avatar
unknown
c_cpp
2 months ago
509 B
2
Indexable
Never
#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());
Leave a Comment