Ejemplo n.º 1
0
        /// <summary>
        ///     Stop sensor readings.
        /// </summary>
        public void Stop()
        {
            var  powerControl = _adxl362.WriteRead(new byte[] { Command.Readegister, Registers.PowerControl, 0x02 }, 1);
            byte power        = (byte)((powerControl[0] & (~PowerControlMask.Measure)) & 0xff);

            _adxl362.WriteBytes(new byte[] { Command.WriteRegister, Registers.PowerControl, power });
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Read the sensors and make the readings available through the
        ///     X, Y and Z properties.
        /// </summary>
        public void Update()
        {
            var sensorReading = _adxl362.WriteRead(new byte[] { 0x0b, Registers.XAxisLSB }, 8);

            X = (short)((sensorReading[3] << 8) | sensorReading[2]);
            Y = (short)((sensorReading[5] << 8) | sensorReading[4]);
            Z = (short)((sensorReading[7] << 8) | sensorReading[6]);
        }