Last active
May 26, 2018 12:52
-
-
Save TakehikoShimojima/0b165ba109260c70a084d4cae5a6f8e8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <M5Stack.h> | |
#include <TinyGPS++.h> | |
HardwareSerial GPS_s(2); | |
TinyGPSPlus gps; | |
void setup() { | |
M5.begin(); | |
GPS_s.begin(9600); | |
} | |
void loop() { | |
while (!gps.location.isUpdated()) { | |
while (GPS_s.available() > 0) { | |
if (gps.encode(GPS_s.read())) { | |
break; | |
} | |
} | |
} | |
Serial.printf("lat: %f, lng: %f\r\n", gps.location.lat(), gps.location.lng()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment