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.

Get Started
Asked — Edited

Math In Ez-Script

How do you do basic math functions within EZ-Script?


ARC Pro

Upgrade to ARC Pro

ARC Early Access will give you immediate updates and new features needed to unleash your robot's potential!

AI Support Bot
Related Content
Synthiam
#2  
I'm not sure I understand the question. I'm new to ez script but I'd guess you'd do it something like this....

Code:


$NumberA= 5
$NumberB = $NumberA - 2
#NumberB now = 3
#or you could do something like....
$NumberA = $NumberA - 2
#NumberA = 3
#There's a command to get servo position (I don't remember it off the top of my head) But you could do something like
$TiltPosition = GetServoPosition(Dx)
#Change servo position 5 positions mathematically
Servo(Dx,$TiltPostion-5)


I'm not 100% on the command names but ez script works just like most other languages.
I believe that all of the operators are covered somewhere in the script help section on the side when you are in the script editor. You may be able to find better info there.

Hope that helps.
United Kingdom
#3  
Yep that's about right. All math functions are explained on the right hand side of EZ-Script, including advanced math functions.

Code:


$result = $valueA + $valueB * valueC / $valueD - $valueE
SayWait($result)