Components Required:
1. Arduino Uno
2. Linux PC/Windows PC (Tested with Windows 10, Ubuntu 14.04 LTS)
3. USB cable A to B
4. SIM28ML GPS Module
5. Jumper Wires
Way to go ->
1. Connect Arduino Uno to PC via the USB cable.
GPS.ino
#include <TinyGPS.h>
TinyGPS gps;
long lat, lon;
void setup() {
Serial.begin(9600);
}
void loop() {
while (Serial.available())
{
int c = Serial.read();
gps.encode(c);
}
gps.get_position(&lat, &lon);
Serial.print("Latitude, Longitude: "); Serial.print(lat * pow(10, -6)); Serial.print(", "); Serial.println(lon * pow(10, -6));
No comments:
Post a Comment