Code:
$regfile = M32def.dat
$crystal = 12000000
$baud = 4800
'------------------------------------------------------------------------------
Dim C As Byte
Dim I As Byte
Dim Sspeed As String * 11
Dim Stime As String * 11
Dim Sdate As String * 11
Dim Soutput As String * 11
'------------------------------------------------------------------------------
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
Do
Print #1 , "hallo"
Waitms 100
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) 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 , 5)
End Function
End
Lesezeichen