示例#1
0
        public void UpdatePid(PidType type, PidObj pid)
        {
            byte[] buffer = new byte[1 + 1 + (3 * BinaryHelper.SIZE_FLOAT) + 1];
            int    i      = 0;

            buffer[i++] = (byte)'P';
            buffer[i++] = PidTypeToCode(type);
            BinaryHelper.WriteFloat(pid.P, buffer, ref i);
            BinaryHelper.WriteFloat(pid.I, buffer, ref i);
            BinaryHelper.WriteFloat(pid.D, buffer, ref i);
            buffer[i++] = BinaryHelper.ComputeChecksumCRC8(buffer, 1, buffer.Length - 1);
            SendRequest(buffer, i);
        }
示例#2
0
 public void UpdatePid(PidType type, PidObj pid)
 {
     byte[] buffer = new byte[1 + 1 + (3 * BinaryHelper.SIZE_FLOAT) + 1];
     int i = 0;
     buffer[i++] = (byte)'P';
     buffer[i++] = PidTypeToCode(type);
     BinaryHelper.WriteFloat(pid.P, buffer, ref i);
     BinaryHelper.WriteFloat(pid.I, buffer, ref i);
     BinaryHelper.WriteFloat(pid.D, buffer, ref i);
     buffer[i++] = BinaryHelper.ComputeChecksumCRC8(buffer, 1, buffer.Length - 1);
     SendRequest(buffer, i);
 }
示例#3
0
 public void UpdateValue(PidObj pid)
 {
     _p.Value = pid.P;
     _i.Value = pid.I;
     _d.Value = pid.D;
 }
示例#4
0
 public void UpdateValue(PidObj pid)
 {
     _p.Value = pid.P;
     _i.Value = pid.I;
     _d.Value = pid.D;
 }