Welcome to Synthiam!

Program robots using technologies created from industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.

Get Started
United Kingdom
Asked — Edited
Resolved Resolved by DJ Sures!

Creating A "Button Release" For Mobile Control

I wrote a post a short while back asking DJ if he would consider adding a "When button is released" script input field to the mobile interface, and he very kindly said the he would add it to his "to do" list.

So in the mean time I have been playing around to see if I could I could script something similar, but so far have had no luck. The only thing I could come up with is the following...

Code:


:loop
IF(GetServo(D19) < 120)
ServoUp(D19, 1)
Sleep(25)
ElseIf(ControlCommand("Script Manager", ScriptStop, "Head LEFT"))
EndIf
Goto(loop)


What this does is when a mobile control button is pressed/pressed and released, it will (for example) move a servo, and when the same button is pressed again the servo will stop. Not quite what I want to do. Has anybody got any ideas of how to do this or has a script example you would be willing to share?

I would be happy to wait for an EZ Builder update to include this, but I have had a couple of near accidents where I take my eyes off my phones screen for a second and haven't been able to hit the stop button that I have, in time. Having this option would solve this issue and I could do away with the stop button altogether.

Many thanks. :)

User-inserted image

AI Support Bot
Related Content
Synthiam
PRO
Synthiam
#1  
There is currently no support for cross-platform "button release" events. When a newer update for the mobile device sdk supports it, I will add it.
United Kingdom
#2  
Thanks DJ. So there's no way to do something similar with scripting that can be added to a mobile control button script in ARC then, as I am currently using a VCN PC remote app?
PRO
Synthiam
#3  
Sure, a start and stop? do this...

Init the $pressed variable in your Connection or Init script, like so

Code:


$pressed = 0


In the button on your mobile form, have an IF condition that switches the variable back and forth between 0 and 1. Where 0 (zero) is false, and 1 (one) is true.

Code:


IF (!$pressed)

Forward()

$pressed = 1
ELSE

Stop()

$pressed = 0

ENDIF
United Kingdom
#4  
Brilliant. Exactly what I was looking for. Thanks very much for that DJ. This will help me out loads. :):)