$regfile = "m8def.dat" ' ATmega8L 8PU $crystal = 3686400 ' für myAVR Board USB $baud = 4800 ' NMEA Schnittstelle Config Lcd = 16 * 2 Config Lcdpin = Pin , Db4 = Portd.4 , Db5 = Portd.5 , Db6 = Portd.6 , Db7 = Portd.7 , E = Portd.3 , Rs = Portd.2 Dim C As Byte Dim I As Byte Dim Stime As String * 6 'Dim Sdate As String * 6 Dim Soutput As String * 8 Declare Sub Wait_for_char(byval C As String) Declare Sub Wait_for_string(byval S As String) Declare Function Read_string() As String Cls Cursor Off Noblink Lcd "Lese $GPRMC..." Wait 2 Cls Config Serialin = Buffered , Size = 100 ' Konfig. der ser. Eingabe 'Config Com1 = Dummy , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0 Enable Interrupts ' $GPRMC,hhmmss.ss,A,llll.ll,a,yyyyy.yy,a,x.x,x.x,ddmmyy,x.x,a*hh NMEA Protokoll orig. ' $GPRMC,140942,A,4933.3757,N,01119.6031,E,0.0,167.0,120408,1.4,E,A*13 NMEA Protokoll Garmin etrex Summit '------------------------------------------------- Do Call Wait_for_string( "$GPRMC,") ' Warte auf $GPRMC Stime = Read_string() ' Lese UTC Zeitangabe Soutput = Left(stime , 2) + ":" + Mid(stime , 3 , 2) + ":" + Mid(stime , 5 , 2) Locate 1 , 1 Lcd Soutput; For I = 1 To 7 ' Lese 7 Komma Call Wait_for_char( ",") Next Sdate = Read_string() Soutput = Left(sdate , 2) + "." + Mid(sdate , 3 , 2) + "." + Mid(sdate , 5 , 2) ' Lese Datum Locate 2 , 1 Lcd Soutput; Loop 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 * 7 Ss = "" Do Cc = Waitkey() Ss = Ss + Chr(cc) Loop Until Cc = "," Read_string = Left(ss , 6) End Function