Send string repeatedly while button is pressed

777 views
Skip to first unread message

Danilo Modica

unread,
Dec 1, 2017, 9:08:40 AM12/1/17
to MIT App Inventor Forum
Hi, i'm very new on app inventor so couldn't do what I wanted. My goal is to send repeatedly a string until a button is pressed and stop the sending when release it. The string is sended throught a call of BLE extension like the attached image. Simply  i want to repeat the call endlessly until I release the button.
If do you know how do it can you explain me in a very simply way please?  
Sorry for the new post but I've already searched and readed other posts but I couldn't find a solution for me 
Cattura.JPG

TimAI2

unread,
Dec 1, 2017, 10:36:49 AM12/1/17
to MIT App Inventor Forum
Use the button touch up and touch down events and a clock

On the touch down event you want to start the clock which will then repeat code blocks for you at timed intervals you choose (say every second in your case ?)

Then for the touch up event stop the clock

Let us know how this goes :)


If you haven't done it already....

Danilo Modica

unread,
Dec 2, 2017, 4:49:53 AM12/2/17
to mitappinv...@googlegroups.com
Hi, thanks  for your answer, I saw it late because I think I would receive a mail when someone answered.
In this time I find a solution using only touch down and touch up event, but I modified the code on arduino to work in this way.
anyhow I would like to understand your solution and try it, but I don't know how set a clock to do what you said cause it's my first time on app inventor.
could you send me  please a screen to how set the blocks with a clock?

TimAI2

unread,
Dec 2, 2017, 6:55:01 AM12/2/17
to MIT App Inventor Forum
See here how to use the clock

Danilo Modica

unread,
Dec 2, 2017, 9:26:51 AM12/2/17
to MIT App Inventor Forum
Thank you very much, with this tutorial I understood how to use a clock in my case. Even if I have already solved in another way it's always beatiful learn new things

TimAI2

unread,
Dec 2, 2017, 9:55:18 AM12/2/17
to MIT App Inventor Forum
Pleased you got your solution. You will find clocks very useful as you progress :)
Reply all
Reply to author
Forward
0 new messages