If I create a app in UWP for example with Template 10. I use C#
I want to have the GpioController
logic in a class or somewhere that will handle all input and output business like set all pins and events.
Like an example, when a button is pressed it will send a POST request to the server, this must work in any view.
If I go to a view and I want to get the status of a pin to show like "The door is open"
Also if for an example a sensor is triggering a pin to HIGH, if i change view it cant trigger buttonPin_ValueChanged
event and or set it to LOW for any reason unless the sensor is LOW.
Even if the pins Power-on Pull is PullDown.
pin = gpio.OpenPin(12);
pin.SetDriveMode(GpioPinDriveMode.InputPullUp);
pin.Write(GpioPinValue.Low);
pin.ValueChanged += buttonPin_ValueChanged;
gpiocontroller
in a separate thread. – Civilian