Asked — Edited

How To Make Image Button Stay Color Until Direction Change?

This is just a question about something I came across.

When using an image button in the ARC mobile interface, if you make the script "forward()", It doesn't change to the running color.

If I add a sleep, it will change color until the sleep is done, regardless of a direction change.

I tried the following script with no prevail.


forward()
If ($direction = "forward")
Waitforchange("stop")
Endif

Any ideas?


ARC Pro

Upgrade to ARC Pro

Your robot can be more than a simple automated machine with the power of ARC Pro!

PRO
Synthiam
#1  

Take a look at any of the examples for roli, JD or six

#2  

Thanks, I didn't realize there was a mobile variable set.

United Kingdom
#3  

There isn't. The variable is set in the code. Similar code is used on other directions so when a different direction is called for the variable changes and the script stops running therefore causing the image to return to the default image rather than the running image.

As DJ said, check the examples for Roli, JD and Six, they all use this method.

PRO
Synthiam
#4  

Also, if your robot does not use an HBridge or additional movement panel... And by that I guess I should elaborate.. The AutoPosition comes in two flavors, one with and one without a movement panel.

So, if you are using the AutoPosition, and would like to keep the last action button pressed, do this..


ControlCommand("Auto Position", AutoPositionAction, "Fast-Forward")
WaitForChange($AutoPositionAction)

#5  

Yea I realized that after I posted. Thanks rich.

Thanks for the info DJ.