UKHAS Wiki

UK High Altitude Society

User Tools

Site Tools


projects:main.py

Differences

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

Link to this comparison view

Next revision
Previous revision
projects:main.py [2007/10/31 09:13]
jcoxon created
projects:main.py [2008/07/19 23:33] (current)
Line 1: Line 1:
-<​code>​+<​code ​python>
 ##  Original code by nick84, http://​www.digitaldawgpound.org/​nick84/​post=222 ##  Original code by nick84, http://​www.digitaldawgpound.org/​nick84/​post=222
 ## ##
Line 5: Line 5:
 ##  http://​www.natrium42.com/​halo/​flight2/​ ##  http://​www.natrium42.com/​halo/​flight2/​
 ## ##
-## Added to by James Coxon for Firefly ​HA Platform+## Added to by James Coxon for Firefly ​HAL Platform
 ## http://​www.pegasushabproject.org.uk/​firefly/​ ## http://​www.pegasushabproject.org.uk/​firefly/​
 ## http://​www.ukhas.org.uk ## http://​www.ukhas.org.uk
Line 94: Line 94:
     if (alt_int > 5000):     if (alt_int > 5000):
         debugmsg('​Cutdown'​)         debugmsg('​Cutdown'​)
-        GPIO.setIOvalue(6, 1)+        GPIO.setIOvalue(4, 1)
         MOD.sleep(10)         MOD.sleep(10)
-        GPIO.setIOvalue(6, 0)+        GPIO.setIOvalue(4, 0)
     else:     else:
         debugmsg('​Still Below 5000m'​)         debugmsg('​Still Below 5000m'​)
Line 102: Line 102:
         ​         ​
 def camera(): def camera():
-        GPIO.setIOvalue(7, 1)+        GPIO.setIOvalue(6, 1)
         MOD.sleep(10)         MOD.sleep(10)
-        GPIO.setIOvalue(7, 0)+        GPIO.setIOvalue(6, 0)
  
 def radio_on_of(on_off):​ def radio_on_of(on_off):​
     if (on_off == '​on'​):​     if (on_off == '​on'​):​
         debugmsg('​Radio on')         debugmsg('​Radio on')
-        GPIO.setIOvalue(51+        GPIO.setIOvalue(70
     elif (on_off == '​off'​):​     elif (on_off == '​off'​):​
         debugmsg('​Radio off')         debugmsg('​Radio off')
-        GPIO.setIOvalue(50)+        GPIO.setIOvalue(71)
  
 def dit(): def dit():
     MOD.sleep(2)     MOD.sleep(2)
-    GPIO.setIOvalue(4, 1)+    GPIO.setIOvalue(3, 1)
     MOD.sleep(1)     MOD.sleep(1)
-    GPIO.setIOvalue(4,0)+    GPIO.setIOvalue(3,0)
  
 def dash(): def dash():
     MOD.sleep(2)     MOD.sleep(2)
-    GPIO.setIOvalue(4, 1)+    GPIO.setIOvalue(3, 1)
     MOD.sleep(2)     MOD.sleep(2)
-    GPIO.setIOvalue(4,0)+    GPIO.setIOvalue(3,0)
     ​     ​
 def morse_code(number):​ def morse_code(number):​
Line 227: Line 227:
         #If GPS position fix valid         #If GPS position fix valid
         if (gps_status(gpspos) == TRUE):         if (gps_status(gpspos) == TRUE):
 +            GPIO.setIOdir(1,​ 1, 1)
             gpsdataparts = gpspos.split(','​)             gpsdataparts = gpspos.split(','​)
  
Line 241: Line 242:
             radio_on_of("​off"​)             radio_on_of("​off"​)
         else:         else:
 +            GPIO.setIOdir(1,​ 0, 1)
             senddata = 'No GPS Fix'             senddata = 'No GPS Fix'
  
Line 246: Line 248:
         debugmsg(senddata)         debugmsg(senddata)
         #Send SMS         #Send SMS
-        #​sms_send('​07748628528', senddata) +        #​sms_send('​xxxxxxxxxxx', senddata) 
-        senddata_bot = 'jacoxon@googlemail.com ' + senddata+        senddata_bot = 'track@natrium42.com ' + senddata
         #​sms_send('​07766404142',​ senddata_bot)         #​sms_send('​07766404142',​ senddata_bot)
         debugmsg('​Powersave for 50 seconds'​)         debugmsg('​Powersave for 50 seconds'​)
projects/main.py.1193822024.txt.gz · Last modified: 2008/07/19 23:32 (external edit)