Arc Adán

unread,
Mar 29, 2018, 11:03:55 AM3/29/18
to MIT App Inventor Forum
So I'm trying to create an app that, for the moment, translates text to Morse code. Then it will vibrate the Morse code when a button is clicked. The translator works so far. The problem is that it does not vibrate. Instead, it show the vibrate button to be constantly pushed down after click and then freezes. I have attached my .aia code. Any help is greatly appreciated.

SecretBuzz (1).aia

TimAI2

unread,
Mar 29, 2018, 12:56:26 PM3/29/18
to MIT App Inventor Forum
Use of the the search box facility at the top of the page will often produce the results you are after :)


Please search for morse code, there has been much work done on this recently on the forum

Abraham Getzler

unread,
Mar 29, 2018, 5:20:54 PM3/29/18
to MIT App Inventor Forum
You have a wait loop in your attached procedure.

See the Waiting and Timing section of FAQ
for why you can't do that.

To time Morse code properly, queue up your dots and dashes and
do only 1 at a time.

Here's a singing speech component example using a timed queue ...
ABG

Capture.PNG

Abraham Getzler

unread,
Mar 29, 2018, 5:35:12 PM3/29/18
to MIT App Inventor Forum
Use this page as a reference ...

You only need to queue true/false values, each item
corresponding to whether or not a unit of time should
be a vibrate or just a Clock Timer shot,
(assuming the vibrate and Timer periods are equal.)

Abraham Getzler

unread,
Mar 29, 2018, 5:43:08 PM3/29/18
to MIT App Inventor Forum

Abraham Getzler

unread,
Mar 29, 2018, 10:53:50 PM3/29/18
to MIT App Inventor Forum
Attached is a working solution,
tested on the emulator,
nice and slow.

ABG

blocks.png
Morse.aia
morse.csv
2018-03-29 22_44_16-5554__build_.png
2018-03-29 22_45_03-5554__build_.png

Abraham Getzler

unread,
Mar 30, 2018, 11:07:22 AM3/30/18
to MIT App Inventor Forum
I had a little sloppiness in the timing between dots and dashes in my earlier post.
Attached is the more accurate version.
ABG

ON_OFF.PNG
encode.PNG
Morse.aia
morse.csv
When_btnTranslate_Click.PNG
When_Clock1_Timer.PNG
When_FileMorse_GotText.PNG
When_screen2_Initialize.PNG
2018-03-29 22_44_16-5554__build_.png
2018-03-29 22_45_03-5554__build_.png
blocks.png
durations.PNG

Abraham Getzler

unread,
Mar 30, 2018, 12:45:25 PM3/30/18
to MIT App Inventor Forum
On live testing on a tablet, I experienced breaks in my dashes,
so I updated the app to request solid vibrations
of 3 time units per dash instead of 3 consecutive vibrations.

See attached for the updated code.

(Third time's the charm)

ABG

When_Clock1_Timer.PNG
blocks.png
Morse.aia
ON_OFF.PNG
sign.PNG
Reply all
Reply to author
Forward
0 new messages