Welcome to Synthiam!

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

Get Started
Asked — Edited
Resolved Resolved by Rich!

If-Then Programming

Can anyone give me info on how to program an If-Then sequence? Ex. If the robot sees a red ball, it will stop, if it sees a green one, it will go forward. Also a screenshot of the programming would be helpful. Thanks!


ARC Pro

Upgrade to ARC Pro

Become a Synthiam ARC Pro subscriber to unleash the power of easy and powerful robot programming

AI Support Bot
Related Content
Synthiam
Based on your post activity, we found some content that may be interesting to you. Explore these other tutorials and community conversations.
United Kingdom
#1  
I have covered IF statements in a few topics, I'll list them in a sec. But to answer this question is very simple;

First you need to make sure you have the camera control set up for colour detection, this will give ARC the global variable called $CameraObjectColor

Then your script would need the following IF statement

Code:


IF($CameraObjectColor = "Red")
Stop()
ELSEIF($CameraObjectColor = "Green")
Forward()
ELSE
# Neither colour detected
Print("No colour detected, awaiting colour to proceed")
EndIf
PRO
Synthiam
#4  
There are dozens of example projects in ARC that demonstrates everything.

1) Start ARC

2) Press OPEN file the FILE menu

3) Press the EXAMPLES button

You will now see sub directories for SCRIPT examples and FUNCTION examples
United Kingdom
#5  
I still keep forgetting about the examples already in ARC, must remember next time:)
#6  
Thanks for the help! I am excited to test it out!