예제 #1
0
        public Dht22Sensor GetHumiditySensor(byte pin)
        {
            lock (_dht22States)
            {
                if (!_dht22States.ContainsKey(pin))
                {
                    _dht22States[pin] = new Dht22State();
                }
            }

            return(new Dht22Sensor(pin, DHT22SensorKind.Humidity, this));
        }
예제 #2
0
        public Dht22Sensor GetTemperatureSensor(int pin)
        {
            lock (_dht22States)
            {
                if (!_dht22States.ContainsKey(pin))
                {
                    _dht22States[pin] = new Dht22State();
                }
            }

            return(new Dht22Sensor(pin, DHT22SensorKind.Temperature, this));
        }