Sir one more thing I am using this particular code for using GPS & GSM:
Could you please tell me that will it do?
And sir in this project do we really need the DS1307 clock as I am facing some problem with it.
$baud = 9600
$crystal = 11059200
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = P0.2 , Db5 = P0.3 , Db6 = P0.4 , Db7 = P0.5 , E = P0.1 , Rs = P0.0
Dim Gps As Byte , X As Byte , Counts As Byte , Latt(6) As Byte , Lont(6) As Byte
Dim Latns As Byte , Lonew As Byte , Timt(6) As Byte
Const Mobileno = "+919999050217"
Declare Sub Readgps
Declare Sub Sendsms
Cursor Off Noblink
Cls
Locate 1 , 1 : Lcd "vechile tracking system"
Locate 2 , 4 : Lcd "GPS & GSM based"
Wait 20
Enable Serial
Enable Interrupts
Wait 1
Counts = 0
Main:
Readgps
Wait 1
Counts = Counts + 1
If Counts = 300 Then
Readgps
Sendsms
Counts = 0
Goto Main
Sub Readgps:
Cls
Cursor Off
Looploop:
Upperline
Startloop:
Gps = Waitkey()
If Gps <> "$" Then Goto Startloop
Gps = Waitkey()
If Gps <> "G" Then Goto Startloop
Gps = Waitkey()
If Gps <> "P" Then Goto Startloop
Gps = Waitkey()
If Gps <> "G" Then Goto Startloop
Gps = Waitkey()
If Gps <> "G" Then Goto Startloop
Gps = Waitkey()
If Gps <> "A" Then Goto Startloop
Gps = Waitkey()
If Gps <> "," Then Goto Startloop
For X = 1 To 6
Gps = Waitkey()
Lcd Chr(gps) ;
Timt(x) = Gps
If X = 2 Then Lcd ":";
If X = 4 Then Lcd ":";
Next X
Timlop:
Gps = Waitkey()
If Gps = "," Then Goto Getlat
Goto Timlop
Getlat:
Lowerline
For X = 1 To 6
Getlat1:
Gps = Waitkey()
If Gps = "." Then Goto Getlat1
Latt(x) = Gps
Lcd Chr(gps);
Next X
Getlat2:
Gps = Waitkey()
If Gps = "," Then Goto Getlat3
Goto Getlat2
Getlat3:
Gps = Waitkey()
If Gps <> "," Then Goto Getlat3
Gps = Waitkey()
Latns = Gps
Lcd Chr(gps) ; " ";
Gps = Waitkey()
Gps = Waitkey()
For X = 1 To 6
Getlon:
Gps = Waitkey()
If Gps = "." Then Goto Getlon
Lont(x) = Gps
Lcd Chr(gps);
Next X
Getlon1:
Gps = Waitkey()
If Gps <> "," Then Goto Getlon1
Gps = Waitkey()
Lonew = Gps
Lcd Chr(gps) ; " ";
End Sub
Sub Sendsms
Disable Serial
Set Scon.1
Print "AT+CMGS=" ; Chr(34) ; Mobileno ; Chr(34)
Reset Scon.1
Enable Serial
Wait 2
Disable Serial
Set Scon.1
For X = 1 To 6
Print Latt(x)
Next X
Print " " ; Latns ; " "
For X = 1 To 6
Print Lont(x)
Next X
Print " " ; Lonew ; Chr(26)
Reset Scon.1
Enable Serial
Cls
Locate 1 , 1 : Lcd "sms sent...."
Wait 1
End If
End Sub