예제 #1
0
        private bool GetOneOutputStatus(byte value, byte pos)
        {
            bool status = false;

            if (ByteLib.GetBit(value, pos) == 1)
            {
                status = true;
            }
            return(status);
        }
예제 #2
0
        private string GetStatusString(byte value, byte pos)
        {
            byte bitValue = ByteLib.GetBit(value, pos);

            if (bitValue == 1)
            {
                return("Hi");
            }
            return("Low");
        }
예제 #3
0
        /// <summary>
        /// update one bit of the output for bank 2
        /// </summary>
        /// <param name="value"></param>
        /// <param name="pos"></param>
        private void UpdateOneBitB2(byte value, byte pos)
        {
            SwitchToMCP23017_1();

            try
            {
                currentOutputStatusB2 = ByteLib.SetBit(currentOutputStatusB2, pos, value);
                byte addr = GetAddress(true);
                CommObj.Send(new byte[] { addr, 19, currentOutputStatusB2 }, 0);
            }
            catch
            {
            }
        }