EDIT12/7/13: I have changed the code quite a bit. The new code includes a lookup table of morse code so that you can insert the text straight into the program and have it converted to morse for you. My motivation for this was the Hackaday Fubarino contest at http://hackaday.com/2013/12/03/new-contest-win-one-of-20-microchip-fubarino-boards/. This easter egg should not be transmitted over ham radio due to it sounding like an advertisement.
A hidden transmitter, or fox as it is sometimes called, is used by amateur radio operators for sport. Somebody hides a fox, and participants use different methods to find it. This is for practice for when there is an illegal transmitter nearby. Then the "hams" know what they are doing when tracking it down.
The transmitter usually transmits a long tone followed by a fcc granted call sign in morse code. The club I am a member of needed one of these, so I sat down and started designing it. I based it around an arduino, though this could be ported to many different microcontrollers.
Step 1: How the Code Works
Writing this code was the first time I used custom functions, as well as an array. First I define values at the top for easy customization. Then i set up the morse code array. After declaring a few more things, I go on to the loop. First it calls my first fuction called playtone(). In the parenthathese you input how long you want it to transmit in milliseconds (1 second == 1000 milliseconds; this adds precision). This is for the hams to track the signal. After this it waits 1 second then calls my second function. called playcode(), which plays a call sign in morse code. This function uses a for loop to read through the array one character at a time. It uses a series of if statements to set the duration. After that playtone(Duration) is called. This plays the sound at the length of the character then the for loop reads the next character of the array. After it has gone through all characters the program delays for a set time, determined by preference. I have it set for 1 minute. Read the comments in the code for more detailed information.
EDIT 12/7/13: In the original code, you must insert the morse for the call sign to be transmitted manually. In the updated (albeit messy, apologies) code, you just need to input the call and any other text in the string Text. For the program to transmit the easterEgg string instead, you must hold pin 10 high at reset. This is what qualifies the project for Hackaday's contest.