Esempio n. 1
0
        public ButtonReader(Action <bool> callback)
        {
            _callBack = callback;

            _controller = GpioControllerFactory.GetController();

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