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); }
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); }