From 8be861aa1fa8c8574682c6731f64587f56955556 Mon Sep 17 00:00:00 2001 From: Brendan Le Foll Date: Tue, 25 Nov 2014 10:37:36 +0000 Subject: [PATCH] hello_isr.py: add counter to example Signed-off-by: Brendan Le Foll --- examples/python/hello_isr.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/examples/python/hello_isr.py b/examples/python/hello_isr.py index c724ece..cb02488 100644 --- a/examples/python/hello_isr.py +++ b/examples/python/hello_isr.py @@ -25,8 +25,16 @@ import mraa import time +class Counter: + count = 0 + +c = Counter() + +# inside a python interupt you cannot use 'basic' types so you'll need to use +# objects def test(args): print("wooo") + c.count+=1 x = mraa.Gpio(6) x.dir(mraa.DIR_IN)