C# Maestro 24 how to change speed

Hi

Can someone who is expert at this tell me how I can modified the code to change the speed of the servo.
0= channel 0
1000*3 go to netural
speed= I don’t know how.

TrySetTarget(0, 1000 * 3);

  void TrySetTarget(Byte channel, UInt16 target)
        {
    
                using (Usc device = connectToDevice())
                {
                    device.setTarget(channel, target);
                 }

        }

Thank in advance.

You should add some code that calls device.setSpeed(). Here’s how I would do it, assuming that you want to set the target and the speed at the same time:

void TrySetSpeedAndTarget(Byte channel, UInt16 speed, UInt16 target)
{
    using (Usc device = connectToDevice())
    {
        device.setSpeed(channel, speed);
        device.setTarget(channel, target);
    }
}

Then when you call TrySetSpeedAndTarget, remember to provide all three arguments.

In general, to discover all the features available in the Usc class, you should type “device.” (note the period at the end) inside the “using” block and then the Visual Studio auto-correct feature will show you all of the functions in the class that you could call, and the arguments they take. You could also just look at the source code of the Usc class in Usc.cs.

Also, who told you that 1000*3 is the neutral position? It should be 1500*4 for typical RC servos.

–David