Introduction: GPS LinkIt One

This is part two of my LinkIt One GPS Tutorial. I have made a script that sends a serial link that will display the location on google maps.

Step 1: Upload Code and Plug in GPS Antenna

Here Is The Code I Made, It makes a URL for you to copy and enter into your web browser to show the gps location


#include<LGPS.h>

gpsSentenceInfoStructinfo;

charbuff[256];

staticunsignedchargetComma(unsignedcharnum,constchar*str){

unsignedchari,j=0;

intlen=strlen(str);

for(i=0;i<len;i++){if(str[i]==',')j++;

if(j==num)returni+1;

}return0;

}

staticdoublegetDoubleNumber(constchar*s){charbuf[10];

unsignedchari;

doublerev;i=getComma(1,s);

i=i-1;strncpy(buf,s,i);

buf[i]=0;

rev=atof(buf);

returnrev;

}

staticdoublegetIntNumber(constchar*s){charbuf[10];

unsignedchari;

doublerev;i=getComma(1,s);

i=i-1;

strncpy(buf,s,i);buf[i]=0;

rev=atoi(buf);returnrev;

}

voidparseGPGGA(constchar*GPGGAstr){

doublelatitude;

doublelongitude;

inttmp,hour,minute,second,num;

tmp=getComma(2,GPGGAstr);

latitude=getDoubleNumber(&GPGGAstr[tmp]);

tmp=getComma(4,GPGGAstr);

longitude=getDoubleNumber(&GPGGAstr[tmp]);

sprintf(buff,"https://www.google.com/maps/@%10.4f,%10.4f,17z",latitude,longitude);

//%10.4fSerial.println(buff);}

voidsetup(){// put your setup code here, to run once:

Serial.begin(115200);

LGPS.powerOn();

Serial.println("LGPS Power on, and waiting ...");

delay(3000);}

voidloop(){

LGPS.getData(&info);

parseGPGGA((constchar*)info.GPGGA);

delay(2000);}

Step 2: Map

Copy ONE url from the serial monitor and past it into your web browser on the map should be a image of where you LinkIt one Board is!!

Step 3: Need Help?

click here for help

Comments

author
Aditya Tripathi made it! (author)2015-10-24

My serial monitor is not working help needed pls help me

author
Aditya Tripathi made it! (author)Aditya Tripathi2015-10-29

Thank you for your efforts but it didn't worked, but then also Thank you.

author
Funguypro made it! (author)Funguypro2015-10-31

Hey, Sorry for this late response. Did you switch the Serial Port?

About This Instructable

530views

6favorites

License:

Bio: I like to create new things! I'm very interested in IOT and just Internet Stuff. I am not responsible for any injury or deaths ... More »
More by Funguypro:See Through Buildings With a DroneDog Water Alarm (V2)Custom PCB's With a Laser Cutter
Add instructable to: