Exemplo n.º 1
0
        private Buttons.ButtonStates ReadStates()
        {
            var bs = Buttons.ButtonStates.None;

            byte[] buttonData = buttonMem.Read();
            int    bitMask    = 1;

            foreach (byte butState in buttonData)
            {
                if (butState != 0)
                {
                    bs |= (Buttons.ButtonStates)bitMask;
                }
                bitMask = bitMask << 1;
            }
            return(bs);
        }
Exemplo n.º 2
0
 private byte[] GetRawData(int idx, int length)
 {
     return(uartMemory.Read(UartRawOffset + idx, length));
 }
Exemplo n.º 3
0
 protected byte[] ReadBytes(int offset, int length)
 {
     return(analogMemory.Read(offset, length));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Gets the tacho count.
 /// </summary>
 /// <returns>The tacho count.</returns>
 /// <param name="port">Motor port to read from</param>
 public Int32 GetCount(MotorPort port)
 {
     return(BitConverter.ToInt32(tachoMemory.Read((int)port * TachoBufferSize + TachoDataOffset, 4), 0));
 }