hello_isr.py: add counter to example
authorBrendan Le Foll <brendan.le.foll@intel.com>
Tue, 25 Nov 2014 10:37:36 +0000 (10:37 +0000)
committerBrendan Le Foll <brendan.le.foll@intel.com>
Tue, 25 Nov 2014 10:37:36 +0000 (10:37 +0000)
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
examples/python/hello_isr.py

index c724ece..cb02488 100644 (file)
 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)