示例#1
0
        private void ClosePin()
        {
            var relayPin      = Convert.ToInt32(_configuration["RelayPin"]);
            var gpioContoller = new System.Device.Gpio.GpioController();

            gpioContoller.OpenPin(relayPin, System.Device.Gpio.PinMode.Output);
            gpioContoller.Write(relayPin, System.Device.Gpio.PinValue.Low);
        }
示例#2
0
        public Task WriteAsync(uint frame)
        {
            var pins = Enumerable
                       .Range(0, PinMapping.Length)
                       .Select(i => new System.Device.Gpio.PinValuePair(PinMapping[i], (System.Device.Gpio.PinValue)((1 << i) & frame)))
                       .ToArray();

            _gpioController.Write(pins);

            return(Task.CompletedTask);
        }