Ejemplo n.º 1
0
        private void Write16BitRegister(byte register, int value)
        {
            short res = (short)((Int16)value * ResolutionCalculationFactor);
            byte  lsb = (byte)res;
            byte  msb = (byte)((Int16)res >> 8);

            I2CTransactions.Write(_adt7410, register, new byte[] { msb, lsb });
        }
Ejemplo n.º 2
0
        private void UpdateResolution(Resolution resolution)
        {
            byte config = I2CTransactions.Read(_adt7410, ConfigurationRegister)[0];

            if (resolution == Resolution.High)
            {
                config |= (1 << 7);
            }
            else
            {
                config = (byte)(config & ~(1 << 7));
            }
            //set bit no 7; 1 = 16bit, 0 = 13bit resolution
            I2CTransactions.Write(_adt7410, ConfigurationRegister, config);
        }
Ejemplo n.º 3
0
 public void ResetRegisterValues()
 {
     I2CTransactions.Write(_adt7410, ResetRegister, 1);
 }
Ejemplo n.º 4
0
 private void Initialize()
 {
     I2CTransactions.Write(_adt7410, ConfigurationRegister, (byte)0x10); //reset on comparator mode (bit 4 = 1)
     Resolution = Resolution.Default;
 }