When the oServoSE Object's Value property is set to a value, that value is sent to the mini ssc II servo controller. The ssc II servo controller is expecting to see a sync byte of 255 followed by a servo select byte of 0 - 15 followed by a position byte of 0 - 254.
A Position method is provided to automate the communications with the ssc II. To use the Position method, two numbers are specified as arguments; the servo number and the position. When the Position method is encountered in code, it will format and send the 3 required bytes to the ssc II. See example below.
When created, the oServoSE Object also creates an instance of the oSerialL object which it uses to control the ssc. The properties of the instance of the oSerialL Object are configured to transmit data at 2400 baud with an inverted serial signal. Modifying this or any other properties of the oSerialL instance will affect the oServoSE Object's operation in ways that could make the it unable to control the ssc. See the oSerialL Help for more detail on how the serial port communicates with devices such as the Scott Edwards Serial Servo controller.
In the following example, the oServoSE Object is used.
'This program creates a oServoSE
'Object which communicates with
'a Scott Edwards SSCII servo
'module via I/O line 24 and
'moves servo number 7 back
'and forth
Dim A As New oServoSE
Sub Main()
A.ioline = 24
Do
A.Position(7,0)
ooPIC.Delay = 100
A.Position(7,254)
ooPIC.Delay = 100
Loop
End Sub
The oServoSE Object requires only one I/O line connected to the ssc II to operate and any of the ooPIC's 31 I/O lines can be used. Be sure to select an I/O line that is not being used for any other purpose. Locate the top 2 pins of the 10-Pin header on the ssc II. The selected I/O line will need to be connected to the 'S' Pin and the Ground line will need to be connected to the 'G' pin on this connector. The oSerialSE communicates with the ssc II at 2400 baud, so be sure to NOT jumper the baud rate selector on the ssc II.