This library is togle sw on/off edge and level decision. input sw level noise and chatting cancel. MDX-20 controler用
Fork of DigitalSw by
Diff: DigitalSw.h
- Revision:
- 5:9198c5c0afcb
- Parent:
- 1:cd8bb4f0b08d
diff -r cd8bb4f0b08d -r 9198c5c0afcb DigitalSw.h --- a/DigitalSw.h Sun Oct 23 09:46:01 2016 +0000 +++ b/DigitalSw.h Sat Oct 29 01:46:17 2016 +0000 @@ -74,9 +74,10 @@ /** Create a DigitalSw port, connected to the specified sw pins * @param sw pin + * @param (option) Register pull 1:PullUp(default), 0:PullDown * @note nothing */ - DigitalSw(PinName sw); + DigitalSw(PinName sw, uint8_t pull = 1); /** * Reset the edge and level. @@ -113,6 +114,7 @@ InterruptIn _sw; + int8_t _pull; volatile int16_t _onEdge; volatile int16_t _offEdge;