![]() The flashing light and download buttons do not currently work when in "Telegraph" mode. ![]() Of course you wouldnt test for exactly equal to 100, but give-or-take 10 or 20. The "Configure" button reveals advanced options to control the frequency and speed and switch between telegraph and radio sound styles. You wouldnt need a very large array, because once you get a gap of 2 x the dot length you can assume you are 2/3 through a dash gap, and therefore at the end of the current letter, which you can now decode. You can choose between hearing the sound, seeing a flashing light, or having your phone vibrate using the "Sound", "Light" and "Vibrate" checkboxes. The "Play", "Pause", "Stop" and "Repeat" buttons control the playback. If a letter cannot be translated a "#" will appear in the output. 0 Comments Then I read his post and saw that he 'upgraded' rather than doing a 'clean install. The text translation will appear in the bottom box. Letters are separated by spaces and words by "/". You can type Morse code into the top box using "." for a dot and "-" or "_" for a dash. This is not a great tool for learning Morse code as looking at the dots and dashes does not help. We can easily trim that away with trim() when decoding it (as we split the string by the spaces to get the letter represented by each code).Just type letters, numbers and punctuation into the top box and the Morse code will appear in the bottom box with a "#" if the character cannot be translated. The decoder table looks confusing at first until you realize that each decode value consists of a 1 as a start bit followed by a 1 for a dash and a zero for a dot. The get_morse() has a space after each morse-code, so that its not cluttered when you encode it. They both have the same array, which we get from a get_morse() function (I just split this into a separate function so it makes fewer lines). I've split it into two functions, an encoder and a decoder. *Here's a tiny piece of my encoder to show you how i did thatīasically the same as the decoder, real simple. $seperation = str_replace(".- ","w",$Words) $seperation = str_replace(".- ","v",$Words) $seperation = str_replace(".- ","u",$Words) $seperation = str_replace("- ","t",$Words) $seperation = str_replace("- ","o",$Words) ![]() $seperation = str_replace("- ","m",$Words) $seperation = str_replace(".- ","j",$Words) $seperation = str_replace(".- ","a",$Words) For your Morse decoder, use an envelope detector or a BFO to make a tone but then analyze the timing and decode the patterns in software. $seperation = str_replace("/ "," ",$Words) get the morse, seperate each letter and then decode and echo the outcome I'm new to php so i'm trying to keep it as simple as possible. I tried a bunch of things, but really i don't know what i'm doing and i can't figure it out. ![]() So i think i have to first get each letter that was put in the decoder, put them in an array and decode them seperately and then put them back together at the end. That didn't work because it would confuse the morse letters and merge them. I tried to make the decoder the same as my encoder by switching the letters with the codes. The code below is what i have for my decoder. I already got the encoder working but i can't figure out how to make the decoder work. I'm making a php morse encoder and decoder for school. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |