Пример #1
0
        private (short x, short y, short z) GetAcceleration()
        {
            const int Length = 3;

            short[] rawData = new short[Length];

            for (int i = 0; i < Length; ++i)
            {
                byte   register = (byte)(DATAX0_REGISTER + i * 2);
                ushort word     = i2cDevice.ReadRegisterWord(register);
                rawData[i] = (short)word;
            }

            return(rawData[0], rawData[1], rawData[2]);
        }