![]() ![]() I know there are somethings I can compress with regard to the Morse to English bit. In addition, I want to know if there is any way I can make the whole project a little more efficient. I want this project to be fitted in a box, or to be made as compact as possible. Now, I think I can make the piezo buzzer sing for me the way I want it to, but I'm not really sure how to receive an input string other than through a keyboard. I want the output to be coming from the piezo buzzer and I want the LCD to show me the same output simultaneously in dashes. I want to feed a string into the serial window. If so, how to do it, is a major question for me. I am assuming there is some way to record the time a button is pressed. When I press the button for a second, it will be a dot and if I press it for three seconds, it is a dash. The buzzer sends a pulse signal, which is read by a sound sensor, and feeds the info to the Arduino. When I give a Morse code input, I want to do it with a button connected to a piezo buzzer. I want to use an LCD display for the output. Similarly, if I enter an English word/sentence, I want the output to be in dots and dashes. I wrote a decoder (not for Arduino though) that used, in effect, a linked list of character values and it works really well but I think the method Grumpy_Mike has described is easier to understand for someone who's just starting to program.I've always wanted to do this project which will allow me to send a message in Morse code and in return, the output will be in English. The way that you have the sender and receiver hooked together means you don't have to worry too much about noise on the incoming signal. I wouldn't use a separate function to send each letter, but it's your project and you have to do something yourself.ĭecoding is whole different problem, but if you get the transmission timing right and set up the decoder properly you can increase or decrease the transmission speed and still have the decoder figure it out. So, your code should be more like this: #define DIT_LENGTH 100įYI the way to convert a morse code speed in words per minute (WPM) into the length of a dit in milliseconds is simply: Between letters there's another space that is 3 dits long and the word space is 7 dits long. From that, a dah is 3*dit and the silence between them is also one dit long. The unit of time for morse code is based on the length of the "dit". The timing of your morse code transmission isn't very good. T->pCallSign = ++pC //start of next segment of callsign *pM = '\0' //terminating null for Morse Buffer ![]() *pM++ = delay //overwrite with delay at end of callsign PC++ //advance to next letter to be translated *-pM = '\3' //overwrite with an inter-letter pause *pM++ = '\1' //store duration of inter-element pause *pM++ = MC //store duration of this Morse element For each Morse element (dot or dash) of the character Get pointer to next character's Morse sequence string/ While the next call sign character is not a semicolon T->Key = FALSE //set morse key to the off state If((int delay = (int)*pC++) Key = TRUE //set morse key to the on stateĭelay = -delay //reverse its sign (make it positive)} T->Repeat = (int)*pC++ //Nº of times it is to be repeated T->Pitch = (int)*pC++ //audio frequency of keying tone PC = t->CallSign //reset ptr to start of callsign data If(*pC = '\0') //if we've reached end of callsign data *pM = t->pMorse //ptr to start of stn's Morse string *pC = t->pCallSign, //ptr to start of next callsign segment *pMC, //ptr to Morse element in MorseCode The code for each letter is expressed as timer Array letters of the Morse Code alphabet where t = ptr to Tx Data structure of stn currently being keyed The following function gets the next callsign segment from CallSign and sets it up as a string of Morse Code timer durations in Morse: Ok but I needed Morse Code transmitter for my flight simulator it takes input from a database and it chucks it out.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |