#### Welcome to Synthiam!

The easiest way to program the most powerful robots. Use technologies by leading industry experts. ARC is a free-to-use robot programming software that makes servo automation, computer vision, autonomous navigation, and artificial intelligence easy.

## How To Declaration Of Multiple Variables.

hi,
im modifying one of the ARC examples for custom object avoidance 2. my robot is avoiding most obsticles right now. but when he gets boxed in I just want it to backup when it detects the left,right, center at 255.
I tried this

#### `Code:`

``if(\$PingL,\$PingR,\$PingC < \$MinDist)  Goto(AllBad)endif``

how can I do this?

here is the code

`Code:# Set the servo left position\$PosL = 20# Set the servo center position\$PosC = 50# Set the servo right position\$PosR = 80# Set the mininum distance\$MinDist = 60# Begin movingForward()PWM(d19,35):Loop# Scan leftServo(d3, \$PosL)Sleep(150)\$PingL = GetPing(d4, d5)if (\$PingL < \$MinDist) Goto(LeftBad)endif# Scan CenterServo(d3, \$PosC)Sleep(150)\$PingC = GetPing(d4, d5)if (\$PingC < \$MinDist) Goto(CenterBad)endif# Scan RightServo(d3, \$PosR)Sleep(150)\$PingR = GetPing(d4, d5)if (\$PingR < \$MinDist) Goto(RightBad)endif# Scan Center againServo(d3, \$PosC)Sleep(150)\$PingC = GetPing(d4, d5)if (\$PingC < \$MinDist) Goto(CenterBad)endif Goto(Loop):AllBadReverse(100,1000)Right(100,960):LeftBadRight(100, 960)Forward(100)Return():CenterBadright(100, 960)Forward(100)Return():RightBadLeft(100, 960)Forward(100)`

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

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
If conditions can include and and or;

`Code:If(\$PingR < \$MinDist and \$PingL < \$MinDist) Goto(AllBad)EndIf`

or for 3
`Code:If(\$PingR < \$MinDist and \$PingL < \$MinDist and \$PingC < \$MinDist) Goto(AllBad)EndIf`
#2
ok I see, thanks

works good now, thank you!
#3
Hey Guys well for deceleration multiple variables must visit that url:

scala> val x, y, z = 1
x: Int = 1
y: Int = 1
z: Int = 1
PRO
Synthiam
#4
@markspend01, sorry. I'm unsure what your post means. Is it a question or a statement? Please elaborate...