AForge.Robotics.Surveyor.SRV1.ControlServos C# (CSharp) Method

ControlServos() public method

Direct servos control of SRV-1 robot.

Servo settings represent timing pulse widths ranging from 1ms to 2ms. 0 corresponds to a 1ms pulse, 100 corresponds to a 2ms pulse, and 50 is midrange with a 1.5ms pulse.

The method sends 'sab' SRV-1 command (see SRV-1 Control Protocol), which controls 2nd bank of servos using 6th and 7th timers.

public ControlServos ( int leftServo, int rightServo ) : void
leftServo int Left servo setting, [0, 100].
rightServo int Right servo setting, [0, 100].
return void
        public void ControlServos( int leftServo, int rightServo )
        {
            // check limts
            if ( leftServo > 100 )
                leftServo = 100;
            if ( rightServo > 100 )
                rightServo = 100;

            Send( new byte[] { (byte) 's', (byte) leftServo, (byte) rightServo } );
        }