Example #1
0
        public static async Task <GpioPin> GetGPIODevice(GPIODevices gpioDevice)
        {
            switch (gpioDevice)
            {
            case GPIODevices.FanRelay:
                return(await GPIOSlave.Initialize(Convert.ToInt32(GPIODevices.FanRelay)));

            case GPIODevices.HumidityRelay:
                return(await GPIOSlave.Initialize(Convert.ToInt32(GPIODevices.HumidityRelay)));

            case GPIODevices.LightRelay:
                return(await GPIOSlave.Initialize(Convert.ToInt32(GPIODevices.LightRelay)));

            default:
                throw new ArgumentOutOfRangeException(nameof(gpioDevice), gpioDevice, null);
            }
        }
Example #2
0
 public PowerRelay(GPIODevices gpioDevice)
 {
     _deviceType = gpioDevice;
 }