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); }
public void UpdateValue(PidObj pid) { _p.Value = pid.P; _i.Value = pid.I; _d.Value = pid.D; }