All Tutorials / Richard R / Ssc-32 Servo Control Via Script

Ssc-32 Servo Control Via Script

Description

Here is a tutorial on how to use the Lynxmotion SSC-32 Servo Board with EZ-Script. *Note: EZ Builder has an SSC-32 control which is also supported in the auto-positioner and native servo controls. This example is only for EZ-Script and the SSC-32 without using the EZ-Builder SSC-32 Control.

Controls

This tutorial uses the following controls. Select a control to view the manual page.

Step 1

*Note: It is recommended to use the EZ-Builder native control for SSC-32. There is no reason to use this tutorial. Find the native control here: http://www.ez-robot.com/Tutorials/Help.aspx?id=216

Someone on the forum contacted me via email and wanted a sample script of how to control the Lynxmotion ssc-32 servo board via a script.... I am posting it here in case anyone else might be interested...

FYI ... EZ Builder now has an SSC-32 control which is also supported in the auto-positioner....

Code:


#This is an example of controlling servos on the ssc-32 servo board via scripts
#However you can now use the auto positioner if you wish to make it easier
#It assumes you have set the SSC-32 for 38,400 baud
#It is connected to URAT port 0 with ground and TX on the EZB
#On the SSC-32 you connect to ground and Rx

UARTInit(0,0,38400) #initialize the ssc-32 on UART port 0, call only once
sleep(1000)
# Be careful I have had some servos burn when I used the min (500) and max (2500) servo positions
#This will move 5 servos to centre position (90)

$pos = "P1500" #1500 = 90, 500~ min and 2500~ max for 1 to 180...

$m_speed = "S1000" #is speed control


UARTWrite(0,0,"#1"+$pos+$m_speed,13) #right index on port 1
UARTWrite(0,0,"#2"+$pos+$m_speed,13) #right middle on port 2
UARTWrite(0,0,"#3"+$pos+$m_speed,13) #right ring on port 3
UARTWrite(0,0,"#4"+$pos+$m_speed,13) #right baby on port 4

sleep(500)
UARTWrite(0,0,"#0"+$pos+$m_speed,13) #right thumb on port 0

Steps