Exemple #1
0
        public void UpdateWindupGuard(double val)
        {
            byte[] buffer = new byte[1 + (1 * BinaryHelper.SIZE_FLOAT) + 1];
            int    i      = 0;

            buffer[i++] = (byte)'W';
            BinaryHelper.WriteFloat(val, buffer, ref i);
            buffer[i++] = BinaryHelper.ComputeChecksumCRC8(buffer, 1, buffer.Length - 1);
            SendRequest(buffer, i);
        }
Exemple #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);
        }