Example #1
0
        public ButtonReader(Action <bool> callback)
        {
            _callBack = callback;

            _controller = GpioControllerFactory.GetController();

            _controller.OpenPin(Constants.PIN_BUTTON, PinMode.Input);
        }
Example #2
0
        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);
        }
Example #3
0
 public Buzzer()
 {
     _controller = GpioControllerFactory.GetController();
     _controller.OpenPin(Constants.PIN_BUZZER, System.Device.Gpio.PinMode.Output);
 }