Need Help With Morse Code Translator

550 views
Skip to first unread message

Anthony Laman

unread,
Apr 29, 2018, 10:15:50 PM4/29/18
to MIT App Inventor Forum
Hi all,

I've been attempting to translate basic text into Morse Code for the past few hours, and I tried using a code like this to get the desired effect.

On the main screen, I had hoped you would just type in a letter or series of letters, and it would come out as the appropriate series of dots and dashes, corresponding to the letter entered.

Instead, whenever I hit the submit button, no matter what I type in, it will immediately show every period and dash that I entered into the replace block. Is there anyway to make it so my english letters will be translated directly into the morse code that the user inputs?

Thank you.



morsecode box.PNG
arep.PNG
dotsanddashes.PNG

Taifun

unread,
Apr 29, 2018, 10:25:12 PM4/29/18
to MIT App Inventor Forum
the join block will not work like that, you have to use nested replace all blocks
but what about doing a search in the forum to find some probably nicer solutions?
Taifun

Trying to push the limits of App Inventor! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.        

SteveJG

unread,
Apr 29, 2018, 10:28:44 PM4/29/18
to MIT App Inventor Forum
How to send Morse Code sequences of dots and dashes has previously been discussed in the Forum Anthony.  Here are several possible links  https://groups.google.com/forum/#!searchin/mitappinventortest/morse$20code%7Csort:date .    Some of these contain blocks and even an aia you can model.  There are more efficient ways of substituting 
dits and dahs ....  periods and dashes that are a graphic representation of morse code.      When Morse is written  for    happy , it is usually written    ..../.-/.--./.--./-.--     .  The real way to represent Morse is to send a sound file of the actual codes.    

See the Forum discussions and have fun.

Regards,
Steve
Reply all
Reply to author
Forward
0 new messages