Eng_mohamad
Newbie level 3
- Joined
- May 5, 2013
- Messages
- 4
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,319
hello
My graduation project is a GSM/GPS Car Tracker.
I am using pic18f452, Mikroc and sim900
i almost finish the project but i have a problem.
i store the coordinates that come from the sim900 to the pic via uart in an array and then i need to convert the coordinates from ddmm.mmmmmm format to decimal format but i cant.
the problem in ddmm.mmmmmm format that i cant send it in a google map link it wont work it must be either dd mm.mmmmmm'E or the ordinary decimal format that consist of degress only dd.dddd something like that
i tried every thing i could think of but i cant manipulate the data inside the array
here is the code:
void GPS(){
char Pos_lo[15],Pos_la[15],Spe[15],x[15];
UART1_Write_Text("AT+CGPSINF=0");
uart1_write(13);
while(1){
if(uart1_data_ready){
Data=UART1_Read();
if(Data==',')break; //data that the micro controller will recieve will be like this:
// mode,longitude,latitude,UTCtime,ttff,num,speed,course
} // all i want is longitude , latitude , speed
} // so i skipped the mode using this command
uart1_read_text(Pos_lo,",",15); //and then stored the longitude inside Pos_lo
uart1_read_text(Pos_la,",",15); //and then stored the latitude inside Pos_la
for(i=0;i<4;i++){ //and then i skipped UTCtime,ttff,num
uart1_read_text(x,",",30);
}
uart1_read_text(Spe,",",30); //and i stored the speed in Spe
}
}
this works fine and i got the longitude and latitude and speed but i cant convert it please help my graduation project presentation is on 22/6/2013
and i still have many things to do
My graduation project is a GSM/GPS Car Tracker.
I am using pic18f452, Mikroc and sim900
i almost finish the project but i have a problem.
i store the coordinates that come from the sim900 to the pic via uart in an array and then i need to convert the coordinates from ddmm.mmmmmm format to decimal format but i cant.
the problem in ddmm.mmmmmm format that i cant send it in a google map link it wont work it must be either dd mm.mmmmmm'E or the ordinary decimal format that consist of degress only dd.dddd something like that
i tried every thing i could think of but i cant manipulate the data inside the array
here is the code:
void GPS(){
char Pos_lo[15],Pos_la[15],Spe[15],x[15];
UART1_Write_Text("AT+CGPSINF=0");
uart1_write(13);
while(1){
if(uart1_data_ready){
Data=UART1_Read();
if(Data==',')break; //data that the micro controller will recieve will be like this:
// mode,longitude,latitude,UTCtime,ttff,num,speed,course
} // all i want is longitude , latitude , speed
} // so i skipped the mode using this command
uart1_read_text(Pos_lo,",",15); //and then stored the longitude inside Pos_lo
uart1_read_text(Pos_la,",",15); //and then stored the latitude inside Pos_la
for(i=0;i<4;i++){ //and then i skipped UTCtime,ttff,num
uart1_read_text(x,",",30);
}
uart1_read_text(Spe,",",30); //and i stored the speed in Spe
}
}
this works fine and i got the longitude and latitude and speed but i cant convert it please help my graduation project presentation is on 22/6/2013
and i still have many things to do