From 02967fddf2bd6ec5cef167566ada3f7d2f39ab4f Mon Sep 17 00:00:00 2001 From: Thomas Preston Date: Tue, 17 Sep 2013 12:00:37 +0100 Subject: [PATCH] added rising/falling edge and also fixed package bug --- CHANGELOG | 23 +++++++++++++++++++++++ pifacecommon/interrupts.py | 4 ++-- pifacecommon/version.py | 2 +- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 8a7ec25..24f851a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,29 @@ Change Log ========== +v3.1.1 +------ +- Added IODIR_FALLING_EDGE and IODIR_RISING_EDGE to replace IODIR_ON and + IODIR_OFF respecitvley. IODIR_ON and IODIR_OFF can still be used in the same + way as before. Falling/Rising Edge are for physical level 1/0, On/Off are for + logical (programmer) level 1/0. + + Physical Level (pifacecommon.read_bit): + IODIR_FALLING_EDGE: 1 -> 0 + IODIR_RISING_EDGE: 0 -> 1 + Logical Level (pifacedigitalio.PiFaceDigital().input_pins[0].value): + IODIR_ON: 0 -> 1 + IODIR_OFF: 1 -> 0 + + Remember the difference: + # switch is unpressed + pifacecommon.read_bit(0, INPUT_PORT) + 1 # physical + pifacedigitalio.PiFaceDigital().input_pins[0].value + 0 # logical + +- Fixed Debian package bug where setup script would not be executed. + v3.1.0 ------ - Added debouncing with adjustable `settle time`. diff --git a/pifacecommon/interrupts.py b/pifacecommon/interrupts.py index 39e8881..93df8fc 100644 --- a/pifacecommon/interrupts.py +++ b/pifacecommon/interrupts.py @@ -19,8 +19,8 @@ # interrupts -IODIR_ON = 0 -IODIR_OFF = 1 +IODIR_FALLING_EDGE = IODIR_ON = 0 +IODIR_RISING_EDGE = IODIR_OFF = 1 IODIR_BOTH = None # IN_EVENT_DIR_OFF = INPUT_DIRECTION_OFF = 1 # IN_EVENT_DIR_BOTH = INPUT_DIRECTION_BOTH = None diff --git a/pifacecommon/version.py b/pifacecommon/version.py index 7f5601d..726691b 100644 --- a/pifacecommon/version.py +++ b/pifacecommon/version.py @@ -1 +1 @@ -__version__ = '3.1.0' +__version__ = '3.1.1'