Code:
$regfile = M32def.dat
$crystal = 12000000
$baud = 9600
'------------------------------------------------------------------------------
Dim C As Byte
Dim I As Byte
Dim Sspeed As String * 2
Dim Stime As String * 2
Dim Sdate As String * 2
Dim Soutput As String * 2
'------------------------------------------------------------------------------
Declare Sub Wait_for_char(byval C As String)
Declare Sub Wait_for_string(byval S As String)
Declare Function Read_string() As String
'------------------------------------------------------------------------------
Open "COMB.0:115200,8,N,1" For Output As #1
Wait 1
Print #1 , "lese ein"
Wait 1
'------------------------------------------------------------------------------
'Config Serialin = Buffered , Size = 200
'Enable Interrupts
'$GPRMC,235945.180,V,0000.0000,N,00000.0000,E,0.00,0.00,120136,,,N*74
'$GPVTG,0.00,T,,M,0.00,N,0.0,K,N*02
'$GPGGA,235945.180,0000.0000,N,00000.0000,E,0,00,99.9,-17.0,M,17.0,M,,0000*7C
'$GPGSA,A,1,,,,,,,,,,,,,99.9,99.9,99.9*09
'$GPGSV,1,1,00*79
'$GPGLL,0000.0000,N,00000.0000,E,235945.180,V,N*44
'$GPRMC,232058.00,A,4740.48501,N,01229.28266,E,1.635,,230310,,,A*73
'$GPVTG,,T,,M,1.635,N,3.029,K,A*2A
'$GPGGA,232058.00,4740.48501,N,01229.28266,E,1,05,1.23,709.9,M,45.3,M,,*5D
'$GPGSA,A,3,29,14,31,02,26,,,,,,,,2.52,1.23,2.21*0C
'$GPGSV,3,1,11,01,42,285,,02,38,086,17,04,16,041,,09,15,148,*74
'$GPGSV,3,2,11,12,61,076,09,14,31,254,30,26,07,199,12,27,14,150,09*7F
'$GPGSV,3,3,11,29,50,217,11,30,78,322,08,31,26,311,29*4A
'$GPGLL,4740.48501,N,01229.28266,E,232058.00,A,A*68
Do
Call Wait_for_string( "$GPRMC,") 'wartet auf $GPRMC
Print #1 , "1"
Sspeed = Read_string()
Print #1 , "2"
For I = 1 To 3
Print #1 , "3"
Call Wait_for_char( ",")
Print #1 , "4"
Next
Print #1 , "5"
Sspeed = Read_string()
Print #1 , "6"
Waitms 100
Print #1 , "7"
Print #1 , Sspeed;
Print #1 , "8"
Loop
Close #1
End
'------------------------------------------------------------------------------
Sub Wait_for_char(byval C As String)
Local Cc As Byte
Do
Cc = Waitkey()
Loop Until Cc = Chr(c)
End Sub
'------------------------------------------------------------------------------
Sub Wait_for_string(byval S As String)
Local Ii As Byte
Local Cc As Byte
Ii = 1
M1:
Cc = Waitkey()
If Cc <> Mid(s , Ii , 1) Then
Goto M1
Else
Incr Ii
If Ii > Len(s) Then Goto M2
Goto M1
End If
M2:
End Sub
'------------------------------------------------------------------------------
Function Read_string() As String
Local Cc As Byte
Local Ss As String * 10
Ss = ""
Do
Cc = Waitkey()
Ss = Ss + Chr(cc)
Loop Until Cc = ","
Read_string = Left(ss , 6)
End Function
End
Danke.
Lesezeichen