public ButtonReader(Action <bool> callback) { _callBack = callback; _controller = GpioControllerFactory.GetController(); _controller.OpenPin(Constants.PIN_BUTTON, PinMode.Input); }
public Led(LedColor color) { _controller = GpioControllerFactory.GetController(); _pinNumber = color switch { LedColor.Red => Constants.PIN_LEDRED, LedColor.Green => Constants.PIN_LEDGREEN, LedColor.Blue => Constants.PIN_LEDBLUE, _ => throw new NotImplementedException(), }; _controller.OpenPin(_pinNumber, PinMode.Output); }
public Buzzer() { _controller = GpioControllerFactory.GetController(); _controller.OpenPin(Constants.PIN_BUZZER, System.Device.Gpio.PinMode.Output); }