UKHAS Wiki

UK High Altitude Society

User Tools

Site Tools


projects:ukhas_glider_project:master

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
projects:ukhas_glider_project:master [2007/09/23 21:56] – new code laurencebprojects:ukhas_glider_project:master [2008/07/19 23:33] (current) – external edit 127.0.0.1
Line 106: Line 106:
 Landcount = 0 Landcount = 0
 Telcounter = 0 Telcounter = 0
 +Portd.3 = 1
 Waitms 100 Waitms 100
 Gpintegerone = Getadc(5) Gpintegerone = Getadc(5)
Line 165: Line 166:
 Gpfloatone = Target_es Gpfloatone = Target_es
 If Target_e <> Gpfloatone Then Target_es = Target_e If Target_e <> Gpfloatone Then Target_es = Target_e
-Portd.3 = 1                                                 'radiocts pullup +Portd.3 = 1 
-Print "Launch!"+Print "Launch!"                                             'radiocts pullup
 Start Watchdog Start Watchdog
 Placemark = 1                                               'write eeprom to say in ascent Placemark = 1                                               'write eeprom to say in ascent
Line 240: Line 241:
 Requestsecond = 1 Requestsecond = 1
 While Clearsecond = 0 While Clearsecond = 0
- Waitus 10 + Waitus 10                                                  'I did commented this out as we should give the slave a message 1 second before the first valid gps 
-Wend +Wend                                                        'but that was a stupid idea as in the slave code, when if first enters the decent loop 
-Requestsecond = 0 +Requestsecond = 0                                           'it waits for a new gps before doing anything other than running off the gyro 
-Waitus 50+Waitus 50                                                   ' the first update after this then goes into the gps lag compensation stage, but NOT YET !!!!
 Printbin #1 , Statuscode                                    'we are going down so let the slave know Printbin #1 , Statuscode                                    'we are going down so let the slave know
  
Line 394: Line 395:
  If Radiocts = 1 Then                                       'is CTS=1 from the radio modem?  If Radiocts = 1 Then                                       'is CTS=1 from the radio modem?
   Call Radiocomms()   Call Radiocomms()
-  Printstring = Str(gpsheading) 
-  Printstring = Left(printstring , 8) 
- 
  End If  End If
 Loop Loop
  
 Sub Checkvoltage() Sub Checkvoltage()
 +S = "UKHASD,"
 Gpintegerone = Getadc(5) Gpintegerone = Getadc(5)
 Gpfloatone = Gpintegerone Gpfloatone = Gpintegerone
 Gpfloatone = Gpfloatone * 9.503 Gpfloatone = Gpfloatone * 9.503
 Gpfloatone = Gpfloatone / 1000 Gpfloatone = Gpfloatone / 1000
-If Radiocts 1 Then Print "Servo voltage=" ; Gpfloatone ; ",";+Printstring Str(gpfloatone )                              'servo 
 +S + Printstring 
 +S = S + ","
 Gpintegerone = Getadc(0) Gpintegerone = Getadc(0)
 Gpfloatone = Gpintegerone Gpfloatone = Gpintegerone
 Gpfloatone = Gpfloatone * 4.250 Gpfloatone = Gpfloatone * 4.250
 Gpfloatone = Gpfloatone / 1000 Gpfloatone = Gpfloatone / 1000
-If Radiocts 1 Then Print "Supply voltage=" ; Gpfloatone+Printstring Str(gpfloatone ) 
 +S = S + Printstring 
 +S = S + "," 
 +Printstring Str(pulselenght) 
 +S = S + Printstring 
 +S = S + "," 
 +Printstring = Str(pulses) 
 +S = S + Printstring 
 +Print S 
 +Print #4 , S
 Telcounter = 0 Telcounter = 0
 End Sub End Sub
Line 419: Line 429:
 While Radiocts = 0 And Gpbyteone < 30                       'wait for radio with timeout While Radiocts = 0 And Gpbyteone < 30                       'wait for radio with timeout
  Waitms 500  Waitms 500
 + Reset Watchdog
  Incr Gpbyteone  Incr Gpbyteone
 Wend Wend
-Print "Cutdown channel=" ; Channel ; " Time=" ; Duration+Print "UKHASC,Cutdown channel=" ; Channel ; " Time=" ; Duration
 If Channel = 1 Then Cutdownpinone = 1 If Channel = 1 Then Cutdownpinone = 1
 If Channel = 2 Then Cutdownpintwo = 1 If Channel = 2 Then Cutdownpintwo = 1
Line 434: Line 445:
 Sub Radiocomms() Sub Radiocomms()
  If Statuscode = 0 Then  If Statuscode = 0 Then
-  Print "UKHAS>" ;+  S = "UKHAS>"
  Else  Else
-  Print "UKHAS<" ;+  S = "UKHAS<"
  End If  End If
- Print Contents(3) Contents(4) Contents(5) Contents(6) Contents(10) ;       'nmea data + S = S + Contents(3) 
- Print #4 , "UKHAS>" ; Contents(3) ; Contents(4) ; Contents(5) ; Contents(6) ; Contents(10) ;+ S = S + Contents(4) 
 + S = S + Contents(5) 
 + S = S + Contents(6) 
 + S = S + Contents(10)                                       'nmea data
  Printstring = Fusing(gpsheading , "#.#")  Printstring = Fusing(gpsheading , "#.#")
- Print "," Printstring; + Printstring = "," Printstring 
- Print #4 , ","Printstring;+ S = S + Printstring
  Printstring = Fusing(target , "#.#")  Printstring = Fusing(target , "#.#")
- Print "," Printstring; + Printstring = "," Printstring 
- Print #4 , ","Printstring;+ S = S + Printstring
  Printstring = Str(rate)  Printstring = Str(rate)
- Print "," Printstring; + Printstring = "," Printstring 
- Print #4 , ","Printstring;+ S = S + Printstring
  Printstring = Str(temperature)  Printstring = Str(temperature)
- Print "," Printstring; + Printstring = "," Printstring 
- Print #4 , ","Printstring; + S = S + Printstring 
- Print "," ; Error; + Printstring = Str(error) 
- Print #4 , Error;+ Printstring = "," + Printstring 
 + S = S + Printstring
  Printstring = Fusing(heading , "#.#")  Printstring = Fusing(heading , "#.#")
- Print "," Printstring; + Printstring = "," Printstring 
- Print #4 , ","Printstring;+ S = S + Printstring
  Printstring = Fusing(filteredrate , "#.#")  Printstring = Fusing(filteredrate , "#.#")
- Print "," Printstring; + Printstring = "," Printstring 
- Print #4 , ","Printstring; + S = S + Printstring 
- Printstring Str(pulselenght+ Gpbyteone Checksum(s
- Print ",; Printstring; + S = S + "*
- Print #4 , "," ; Printstring; + Printstring = Hex(gpbyteone
- Printstring = Str(pulses+ S = S + Printstring 
- Print ","Printstring + Print S 
- Print #4 , "," ; Printstring                               'we copy everything to the logger+ Print #4 , S
 End Sub End Sub
 </code> </code>
projects/ukhas_glider_project/master.1190584611.txt.gz · Last modified: 2008/07/19 23:32 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki