Esempio n. 1
0
        /// <summary>
        /// Connect to the GY63 using I2C (PS must be pulled high)
        /// </summary>
        /// <param name="i2c"></param>
        /// <param name="address">0x76 is CSB is pulled low, 0x77 if CSB is pulled high</param>
        /// <param name="resolution"></param>
        public Ms5611(II2cBus i2c, byte address = 0x76, Resolution resolution = Resolution.OSR_1024)
        {
            switch (address)
            {
            case 0x76:
            case 0x77:
                // valid address is either 0x76 or 0x77
                break;

            default:
                throw new ArgumentOutOfRangeException("Address must be 0x76 or 0x77");
            }

            ms5611 = new Ms5611I2c(i2c, address, resolution);
        }
Esempio n. 2
0
 /// <summary>
 /// Connect to the Ms5611 using SPI (PS must be pulled low)
 /// </summary>
 /// <param name="spi"></param>
 /// <param name="resolution"></param>
 public Ms5611(ISpiBus spi, IPin chipSelect, Resolution resolution = Resolution.OSR_1024)
 {
     ms5611 = new Ms5611Spi(spi, chipSelect, resolution);
 }