Beispiel #1
0
        private bool TryFetchValues(int pin, out float temperature, out float humidity)
        {
            temperature = 0;
            humidity    = 0;

            var command = new ReadDHT22SensorCommand((byte)pin);

            _i2CHardwareBridge.ExecuteCommand(command);

            if (command.Response == null || !command.Response.Succeeded)
            {
                return(false);
            }

            temperature = command.Response.Temperature;
            humidity    = command.Response.Humidity;
            return(true);
        }
Beispiel #2
0
#pragma warning restore 0067

        public void SendCode(Lpd433MhzCode code)
        {
            var command = new SendLDP433MhzSignalCommand().WithPin(_pin).WithCode(code.Value).WithLength(code.Length).WithRepeats(code.Repeats);

            _i2CHardwareBridge.ExecuteCommand(command);
        }