Exemplo n.º 1
0
        private void Initialize()
        {
            if (this.Precision > Bmp085Precision.Highest)
            {
                this.Precision = Bmp085Precision.Highest;
            }

            if (this.ReadByte(0xD0) != 0x55)
            {
                throw new InvalidOperationException("Device is not a BMP085 barometer");
            }

            /* read calibration data */
            this.ac1 = this.ReadInt16(Interop.CalAc1);
            this.ac2 = this.ReadInt16(Interop.CalAc2);
            this.ac3 = this.ReadInt16(Interop.CalAc3);
            this.ac4 = this.ReadUInt16(Interop.CalAc4);
            this.ac5 = this.ReadUInt16(Interop.CalAc5);
            this.ac6 = this.ReadUInt16(Interop.CalAc6);

            this.b1 = this.ReadInt16(Interop.CalB1);
            this.b2 = this.ReadInt16(Interop.CalB2);

            this.mb = this.ReadInt16(Interop.CalMb);
            this.mc = this.ReadInt16(Interop.CalMc);
            this.md = this.ReadInt16(Interop.CalMd);
        }
Exemplo n.º 2
0
        private void Initialize()
        {
            if (precision > Bmp085Precision.Highest)
            {
                precision = Bmp085Precision.Highest;
            }

            if (ReadByte(0xD0) != 0x55)
            {
                throw new InvalidOperationException("Device is not a BMP085 barometer");
            }

            /* read calibration data */
            ac1 = ReadInt16(Interop.CAL_AC1);
            ac2 = ReadInt16(Interop.CAL_AC2);
            ac3 = ReadInt16(Interop.CAL_AC3);
            ac4 = ReadUInt16(Interop.CAL_AC4);
            ac5 = ReadUInt16(Interop.CAL_AC5);
            ac6 = ReadUInt16(Interop.CAL_AC6);

            b1 = ReadInt16(Interop.CAL_B1);
            b2 = ReadInt16(Interop.CAL_B2);

            mb = ReadInt16(Interop.CAL_MB);
            mc = ReadInt16(Interop.CAL_MC);
            md = ReadInt16(Interop.CAL_MD);
        }
        private void Initialize()
        {
            if (precision > Bmp085Precision.Highest)
                precision = Bmp085Precision.Highest;

            if (ReadByte(0xD0) != 0x55)
                throw new InvalidOperationException("Device is not a BMP085 barometer");

            /* read calibration data */
            ac1 = ReadInt16(Interop.CAL_AC1);
            ac2 = ReadInt16(Interop.CAL_AC2);
            ac3 = ReadInt16(Interop.CAL_AC3);
            ac4 = ReadUInt16(Interop.CAL_AC4);
            ac5 = ReadUInt16(Interop.CAL_AC5);
            ac6 = ReadUInt16(Interop.CAL_AC6);

            b1 = ReadInt16(Interop.CAL_B1);
            b2 = ReadInt16(Interop.CAL_B2);

            mb = ReadInt16(Interop.CAL_MB);
            mc = ReadInt16(Interop.CAL_MC);
            md = ReadInt16(Interop.CAL_MD);
        }