' Flight7.bs2 ' by John Nordlie, November 17, 1999 ' This program is the flight sequencer and id transmitter for ' the High Altitude Research Group balloon payload #4 ' ** set up variables ** x var byte i var byte master var word ' ** set output ports ** output 0 ' pin 0 is the cutdown servo output 1 ' pin 1 keys the transmitter output 2 ' pin 2 is the audio output to the transmitter output 3 ' pin 3 is the audio output to the speaker input 4 ' pin 4 is connected to thermistor #1 Not used on this flight input 5 ' pin 5 is connected to thermistor #2 Not used on this flight output 6 ' pin 6 is the horizontal 35mm camera servo Not used on this flight output 7 ' pin 7 is the cutdown relay Not used on this flight ' ** initialize variables ** master = 60 ' set mission master clock to 2 hours to cutdown ' ** park servo for i=1 to 50 ' move cutdown servo to closed position pulsout 0,150 pause 20 next gosub beep ' beep speaker to let us know the computer is awake ' ** start of main program ** start: gosub track ' transmit 60 second tracking signal pause 1000 ' wait for APRS packet gosub id ' transmit id pause 1000 ' wait for APRS packet for x=1 to 30 ' beep the speaker 30 times (1 minute) gosub beep next master = master - 1 ' decrement master mission clock if master=0 then cutdown ' if its time, cut the balloon free ret4: goto start ' do it all again ' ** main program ends, procedures start here ** ' ** procedure beep causes the on-board speaker to play some notes ** beep: freqout 3,500,3000 freqout 3,500,2000 freqout 3,500,3000 freqout 3,500,2000 return ' ** procedure track transmits a 30 second audio tone for tracking purposes. track: high 1 ' key transmitter pause 500 ' wait for squelch to open freqout 2, 60000, 1250 ' output 60 sec tone for tracking pause 1000 low 1 ' release transmitter key return ' ** procedure id transmits the callsign KC0CRU ** id: high 1 ' key transmitter pause 500 ' wait for squelch on receivers to open freqout 2,300,1000 ' transmit K in morse code pause 66 freqout 2,100,1000 pause 66 freqout 2,300,1000 pause 200 freqout 2,300,1000 ' transmit C pause 66 freqout 2,100,1000 pause 66 freqout 2,300,1000 pause 66 freqout 2,100,1000 pause 200 for i=1 to 5 ' transmit 0 freqout 2,300,1000 pause 66 next pause 200 freqout 2,300,1000 ' transmit C pause 66 freqout 2,100,1000 pause 66 freqout 2,300,1000 pause 66 freqout 2,100,1000 pause 200 freqout 2,100,1000 ' transmit R pause 66 freqout 2,300,1000 pause 66 freqout 2,100,1000 pause 200 freqout 2,100,1000 ' transmit U pause 66 freqout 2,100,1000 pause 66 freqout 2,300,1000 pause 66 pause 1000 low 1 ' release radio key return ' ** procedure cutdown fires the relay which triggers the cut-down mechanism cutdown: for i=1 to 50 ' move cutdown servo to open position pulsout 0,700 pause 20 next master = 2000 ' reset master mission clock to something absurd (66 hours) goto ret4