예제 #1
0
        /// <summary>
        /// Testing method for TempHumidSI70 module (function never returns)
        /// </summary>
        static void TestTempHumidSi70()
        {
            //test button, light sense, gas sense, temp humid
            TempHumidSI70 tempSensor = new TempHumidSI70(GHIElectronics.TinyCLR.Pins.G400S.I2cBus.I2c1);

            while (true)
            {
                Debug.WriteLine($"temp & humid : {tempSensor.TakeMeasurement().Temperature} - {tempSensor.TakeMeasurement().RelativeHumidity}");
                Thread.Sleep(200);
            }
        }
예제 #2
0
        public double GetTemperature()
        {
            var measurement = tempHumid.TakeMeasurement();

            return(measurement.Temperature);
        }
예제 #3
0
        public double GetHumidity()
        {
            var measurement = tempHumid.TakeMeasurement();

            return(measurement.RelativeHumidity);
        }