Das Open-Control-Projekt - Die Alternative zur C-Control-I


Das Forum zur C-Control-1
Welche C-Control-Varianten existieren?
Übersicht - Suchen - Neueste 50 Beiträge - Neuer Beitrag - Login - Registrieren
INFO - FAQ - CC2-Forum - CCPro-Forum 

 Re: Controller stürtz ab! Hilfe!!!! Kategorie: C-Control I V1.2/2.0 (von Stefan Süßmann - 5.07.2006 11:40)
 Als Antwort auf Re: Controller stürtz ab! Hilfe!!!! von Amiwerewolf - 5.07.2006 10:53
> Dim temp As Byte
> Dim logLED As Boolean Port [1,4]
> Dim testLED As Boolean Port [1,5]
> Dim satLED As Boolean Port [1,6]
> Dim akkuLED As Boolean Port [1,7]
> Dim battpower As Boolean Port [1,8]
> Dim rs232switch As Boolean Port [2,6]
> Dim HexA,HexB As Byte
> Dim breiteA,breiteB,breiteC,breiteD As Byte
> Dim langA,langB,langC,langD As Byte
> Dim GPSsignal As Boolean
> Dim GPSsat As Byte
> Dim loginterval, logcounter As Byte
>
> '$INCLUDE "boot.xml"
>
> 'rs232switch=1
> loginterval = 3
> logLED = 0
> testLED = 0
> logLED = 1
> logLED = 0
> waitforhandshake
> do
>
>   Call pufferleeren
>   'call anz_satinfo
>   Call pufferleeren
>   'If logcounter >= loginterval Then Call logging
>   'End If
>   'call akkucheck
>
> loop
>
>   Do
>     If InStat <> 0 Then
>        temp = inkey$
>     End If
>
>   Loop Until temp =36 '$
>  
>  
>   afterhandshake
>   temp = InKey$ :If temp <> 71 Then return :End If 'G
>   temp = inkey$ :If temp <> 80 Then return :End If 'P
>   temp = inkey$ :If temp <> 71 Then return :End If 'G
>   temp = inkey$ :If temp <> 71 Then return :End If 'G
>   temp = inkey$ :If temp <> 65 Then return :End If 'A
>   Print "Datensatz Start"
>   testLED = 1
>   Do
>   Loop Until inkey$ = 44
>   Do
>   Loop Until inkey$ = 44
>   HexA = inKey$-48
>   HexB = inkey$-48
>   breiteA = (HexA*10)+HexB
>   HexA =inkey$-48
>   HexB =inkey$-48
>   breiteB = (HexA*10)+HexB
>   temp = inkey$    '   Empfängt "."
>   HexA =inkey$-48
>   HexB =inkey$-48
>   breiteC = (HexA*10)+HexB
>   HexA =inkey$-48
>   HexB =inkey$-48
>   breiteD = (HexA*10)+HexB
>   Do
>   Loop Until inkey$ = 44
>   temp =inkey$
>   Do
>   Loop Until inkey$ = 44
>   HexA = inKey$-48                     'grad
>   HexB = inkey$-48                     'grad
>   temp = inkey$-48                     'grad
>   langA = (HexA*100)+(HexB*10)+temp
>   HexA =inkey$-48                      'min
>   HexB =inkey$-48                      'min
>   langB = (HexA*10)+HexB
>   temp = inkey$                        'komma
>   HexA =inkey$-48                      'dezmin
>   HexB =inkey$-48                      'dezmin
>   langC = (HexA*10)+HexB
>   HexA =inkey$-48                      'dezmin
>   HexB =inkey$-48                      'dezmin
>   langD = (HexA*10)+HexB                   'dezmin
>   Do
>   Loop Until inkey$ = 44
>   Do
>   Loop Until inkey$ = 44
>   If inkey$-48 > 0 Then
>     GPSsignal = 1
>     logcounter = logcounter + 1
>     Else GPSsignal = 0
>   End If
>   temp = inkey$
>   'Print GPSsignal
>   hexA= inkey$-48
>   hexB= inkey$-48
>   GPSsat=(HexA*10)+HexB
>   'print gpssat
>   Do
>     temp = inkey$
>   Loop Until  temp = 13 Or temp = 10
>
>   testLED = 0
>   print "datensatz ende"
>   Return
>   'GoTo waitforhandshake
>
>
> Sub pufferleeren
>  do
>  If InStat <> 0 Then
>     temp = inkey$
>     If temp = 36 Then GoSub afterhandshake
>     End If
>     Print "FIFO geleert"
>  End If
>
>  Loop Until InStat = 0
>
> End Sub
>
> Sub anz_satinfo
>   If GPSsignal = -1 Then
>     For temp = 1 To GPSsat
>     satLED = 1
>     Pause 1
>     satled = 0
>     Pause 1
>     Next
>     Pause 5
>   End If
> end sub
>
> Sub logging
>   'Ansteuerung eines I2C EEPEROM
>   logcounter=0
>   logLED = 1
>   Pause 1
>   logLED = 0
> End Sub
>
> Sub akkucheck
>    If battpower = 0 Then
>      akkuLED = 1
>      Pause 1
>      akkuLED = 0
>      pause 5
>    else
>      akkuLED = 1
>    end if
> End Sub


Mit diesem basic tue ich mich etwas schwer.
Ich vermisse eine Deklaration für InStat,
ich vermisse eine Einstellung der seriellen Schnittstelle,
ich verstehe auch nicht, wie Du gleichzeit ein Terminalprogramm am PC und einen GPS-Empfänger angeschlossen hast.
Mit 9600 baud wirst Du die Berechnungen während des Einlesens vielleicht nicht mehr schaffen, bei 4800 sollte es gehen. Wohin springt das Return bei der Abfrage auf GPGGA?

Fragen über Fragen :-)

mfg

Stefan

 Antwort schreiben

Bisherige Antworten:

Re: Controller stürtz ab! Hilfe!!!! (von Amiwerewolf - 6.07.2006 13:48)