Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public QButton(IGpioPin gpioPin, ulong interruptTimeMS)
- {
- _gpioPin = gpioPin;
- InterruptTime = interruptTimeMS;
- _gpioPin.InputPullMode = GpioPinResistorPullMode.PullDown;
- _gpioPin.PinMode = GpioPinDriveMode.Input;
- _gpioPin.RegisterInterruptCallback(EdgeDetection.FallingAndRisingEdge, HandleInterrupt);
- }
- private void HandleInterrupt()
- {
- // HandleButtonPressed();
- if (_gpioPin.Read())
- {
- HandleButtonPressed();
- }
- else
- {
- HandleButtonReleased();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement