From dcc4efbaf86a8908a84d9363968fe23365b2691a Mon Sep 17 00:00:00 2001 From: Brendan Le Foll Date: Fri, 19 Sep 2014 01:06:59 +0100 Subject: [PATCH] hello_isr.py: add sleep to the example to reduce confusion Signed-off-by: Brendan Le Foll --- examples/python/hello_isr.py | 3 +++ src/python/docs/example.rst | 3 +++ 2 files changed, 6 insertions(+) diff --git a/examples/python/hello_isr.py b/examples/python/hello_isr.py index bc330ff..c724ece 100644 --- a/examples/python/hello_isr.py +++ b/examples/python/hello_isr.py @@ -23,6 +23,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE import mraa +import time def test(args): print("wooo") @@ -30,3 +31,5 @@ def test(args): x = mraa.Gpio(6) x.dir(mraa.DIR_IN) x.isr(mraa.EDGE_BOTH, test, test) + +time.sleep(500) diff --git a/src/python/docs/example.rst b/src/python/docs/example.rst index 1b5ce32..f1b1e04 100644 --- a/src/python/docs/example.rst +++ b/src/python/docs/example.rst @@ -28,6 +28,9 @@ controlled by the mode that the 'edge' is in. :prepend: import mraa :start-after: import mraa +**Note:** If the python script is ended the destructors will run meaning that +the ISR will not run. The sleep call is there for that function. + I2c ===