Beispiel #1
0
 public int ServoGetAngle(ServoIndex axisIndex)
 {
     byte[] buff = new[]
     {
         (byte)ServoCommands.GetAngle,
     }
     .Concat(((byte)axisIndex).NumToArray());
     byte[] answer = SendCommand(ControllerEnum.ServoController, buff, true);
     return(answer.ArrayToNum());
 }
Beispiel #2
0
        //angle must be in [0, 180] range
        public bool ServoSetAngle(ServoIndex axisIndex, int angle)
        {
            if (angle < MinServoAngle || angle > MaxServoAngle)
            {
                return(false);
            }

            byte[] buff = new []
            {
                (byte)ServoCommands.SetAngle,
            }
            .Concat(((byte)axisIndex).NumToArray())
            .Concat(Delimiter)
            .Concat(angle.NumToArray());
            SendCommand(ControllerEnum.ServoController, buff);
            return(true);
        }