Output Audio From EZ-B icon Output Audio From EZ-B — Example ARC skill demonstrating converting, compressing and streaming MP3/WAV to an EZ-B speaker, with play/stop commands and TTS examples. Try it →
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?

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
EZ-B IoTiny works with Synthiam ARCx to control servos, camera, voice, scripts, and IoT from any browser.
Wi-Fi
Servos 8
Camera
Audio
UART None (transmit-only serial on digital ports)
I2C
ADC 2
Digital 8

ARC Pro

Upgrade to ARC Pro

Unleash your creativity with the power of easy robot programming using Synthiam ARC Pro

#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