Asked
Resolved Resolved by Dave Schulpius!

How Do You Invert The Servo Direction In A INIT Script?

How do you invert the servo direction in a INIT script?  I need to invert the direction of a servo and I can’t find a way to do it in EZscript as part of the INIT script.



Related Hardware (view all EZB hardware)
EZ-B Iotiny by EZ-Robot
Control IoTiny with Synthiam ARC: 100MHz Cortex‑M4 Wi‑Fi IoT/robot controller-camera, servos, ADC, I2C and digital I/O for easy internet automation
Wi-Fi / USB
Servos 8
Camera
Audio
UART
I2C
ADC
Digital

ARC Pro

Upgrade to ARC Pro

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

#9  

Outstanding. So how does it look on paper? Do you make the max the lower number and the min the higher?

#10  

So let me explain because of this design to make the head go up and down both servos need to move at the same time.  the issue is the right servo needs to move in the reverse direction of the left servo. So when I want the head to look up both servo's push down on the links tilting the front up!

So I want to be able to set right and left servo movements using the same values for up and down movements.

User-inserted image

So to do this in the INIT script I just set the right servo that will always be made inverted in servo skills the same as the none inverted left servo.

# specify the ranges for the servos
# this prevents the servos from ever going past these limits

# Head Rotation
SetServoMin(0.D0, 57)
SetServoMax(0.D0, 160)

# Left Neck
SetServoMin(0.D2, 60)
SetServoMax(0.D2, 160)

# Right Neck
SetServoMin(0.D3, 60)
SetServoMax(0.D3, 160