Exemplo n.º 1
0
 void Setup(GpioPin portX, GpioPin portY, GpioPin portA, GpioPin portB,
            GpioPin portSelect, GpioPin portJoyHorizontal, GpioPin portJoyVertical)
 {
     ButtonA.PressEnded      += (s, e) => OnA?.Invoke(s, e);
     ButtonB.PressEnded      += (s, e) => OnB?.Invoke(s, e);
     ButtonX.PressEnded      += (s, e) => OnX?.Invoke(s, e);
     ButtonY.PressEnded      += (s, e) => OnY?.Invoke(s, e);
     ButtonSelect.PressEnded += (s, e) => OnSelect?.Invoke(s, e);
 }
Exemplo n.º 2
0
        public JoyWing(IDigitalInputPort portX, IDigitalInputPort portY, IDigitalInputPort portA, IDigitalInputPort portB,
                       IDigitalInputPort portSelect, IDigitalInputPort portJoyHorizontal, IDigitalInputPort portJoyVertical)
        {
            /*  ButtonA = new PushButton(portA);
             * ButtonB = new PushButton(portB);
             * ButtonX = new PushButton(portX);
             * ButtonY = new PushButton(portY);
             * ButtonSelect = new PushButton(portSelect);*/

            ButtonA.PressEnded      += (s, e) => OnA?.Invoke(s, e);
            ButtonB.PressEnded      += (s, e) => OnB?.Invoke(s, e);
            ButtonX.PressEnded      += (s, e) => OnX?.Invoke(s, e);
            ButtonY.PressEnded      += (s, e) => OnY?.Invoke(s, e);
            ButtonSelect.PressEnded += (s, e) => OnSelect?.Invoke(s, e);
        }