Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. public QButton(IGpioPin gpioPin, ulong interruptTimeMS)
  2. {
  3. _gpioPin = gpioPin;
  4. InterruptTime = interruptTimeMS;
  5. _gpioPin.InputPullMode = GpioPinResistorPullMode.PullDown;
  6. _gpioPin.PinMode = GpioPinDriveMode.Input;
  7. _gpioPin.RegisterInterruptCallback(EdgeDetection.FallingAndRisingEdge, HandleInterrupt);
  8.  
  9. }
  10.  
  11. private void HandleInterrupt()
  12. {
  13. // HandleButtonPressed();
  14. if (_gpioPin.Read())
  15. {
  16. HandleButtonPressed();
  17. }
  18. else
  19. {
  20. HandleButtonReleased();
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement