2014-05-20 15:39:58 +01:00
|
|
|
#######
|
|
|
|
|
Example
|
|
|
|
|
#######
|
2014-06-24 17:24:54 +01:00
|
|
|
Here are some examples of how to use pymraa, common convention is to import pymraa as mraa to keep it short but feel free to import it globally!
|
2014-05-20 15:39:58 +01:00
|
|
|
|
|
|
|
|
Hello GPIO
|
|
|
|
|
==========
|
|
|
|
|
|
2014-06-24 17:24:54 +01:00
|
|
|
Here is the simplest Gpio program in pymraa.
|
2014-05-20 15:39:58 +01:00
|
|
|
|
|
|
|
|
.. literalinclude:: ../../../examples/python/hello_gpio.py
|
2014-06-24 17:24:54 +01:00
|
|
|
:prepend: import pymraa
|
|
|
|
|
:start-after: import pymraa
|
2014-05-20 15:39:58 +01:00
|
|
|
|
|
|
|
|
GPIO Interupt (isr)
|
|
|
|
|
===================
|
|
|
|
|
|
|
|
|
|
The GPIO module allows you to set an interupt on a GPIO. This interupt is controlled by the mode that the 'edge' is in.
|
|
|
|
|
|
|
|
|
|
**Note:** Galileo Gen1 only supports EDGE_BOTH
|
|
|
|
|
|
|
|
|
|
.. literalinclude:: ../../../examples/python/hello_isr.py
|
2014-06-24 17:24:54 +01:00
|
|
|
:prepend: import pymraa as mraa
|
|
|
|
|
:start-after: import pymraa as mraa
|
2014-05-20 15:39:58 +01:00
|
|
|
|