'----------------------------------------------------------------
'FOX10
'By Gerald Crenshaw WD4BIS
'Automated Fox for Amateur Radio Direction finding fox hunting or
'Morse code ID and Keyer for a Beacon Station
'----------------------------------------------------------------
'---------Constants--------------
tone con 1200 '1200 hz tone for the Morse ID
dit_ con 100 'Time in ms for DIT subroutine
dah_ con 300 'Time in ms for DAH subroutine, Time must be 3 times larger than dit
'---------Program----------------
start:
Gosub keyPTT 'Key the transmitter
Gosub dit 'send W
Gosub dah
Gosub dah
Pause dah

Gosub dah 'send D
Gosub dit
Gosub dit
Pause dah

Gosub dit 'Send 4
Gosub dit
Gosub dit
Gosub dit
Gosub dah
Pause dah

Gosub dah 'Send B
Gosub dit
Gosub dit
Gosub dit
Pause dah

Gosub dit 'Send I
Gosub dit
Pause dah

Gosub dit 'Send S
Gosub dit
Gosub dit
Pause dah

Gosub Bubbleup 'bubble up tone
Freqout 1,60000,1000 'Sends a 1000 hz tone for 60 seconds out of I/O Pin 1
Gosub Bubbledown 'bubble down tone
Gosub unkeyPTT 'unkeys Transmitter
pause 60000 'waits 60 seconds
goto start 'Returns to begining of program

'------------SUBROUTINES--------------
dah: 'dah subroutine
  freqout 1,dah_,tone
  pause dit_
return

dit: 'dit subroutine
  freqout 1,dit_,tone
  pause dit_
return

keyPTT: 'Key Xmtr, Takes I/O Pin 0 High, Takes I/O Pin 3 Low.
  high 0 Take P0 High
  low 3 Takes P3 Low
  pause 300 Pause .3 second to give Xmtr time to key
return

unkeyPTT: 'Drop Xmtr Returns I/O Pin 1 and 3 to original state
  low 0 'Take P0 Low
  high 3 'Take P3 High
return

Bubbleup: 'Bubbleup tone
  freqout 1,dit_,500
  freqout 1,dit_,600
  freqout 1,dit_,700
  freqout 1,dit_,800
return

Bubbledown: 'Bubbledown tone
  freqout 1,dit_,800
  freqout 1,dit_,700
  freqout 1,dit_,600
  freqout 1,dit_,500
return