HT16K33 Animator (8X8) icon HT16K33 Animator (8X8) — Control for Adafruit 8x8 LED Matrix (HT16K33) via EZ-B v4 I2C; creates animations, supports module initialization and EZ-Script control. Try it →
Asked — Edited
2 Participants

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

ARC Pro is your gateway to a community of like-minded robot enthusiasts and professionals, all united by a passion for advanced robot programming.

Author Avatar
PRO
Synthiam
LinkedIn Thingiverse Twitter YouTube GitHub
#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.

Author Avatar
United Kingdom
LinkedIn Twitter Google+ YouTube
#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.

Author Avatar
PRO
Synthiam
LinkedIn Thingiverse Twitter YouTube GitHub
#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.