Example: get state of a button. More...
Go to the source code of this file.
Variables | |
button2.PIN = P8_07 | |
the header pin to watch | |
button2.io = pruio_new(PRUIO_DEF_ACTIVE, 4, 0x98, 0) | |
Create a ctypes pointer to the pruio structure. | |
button2.IO = io.contents | |
The pointer dereferencing, using contents member. | |
button2.end | |
Example: get state of a button.
This file contains an example on how to use libpruio to get the state of a button connetect to a GPIO pin on the beaglebone board. Here pin 7 on header P8 is used as input with pullup resistor. Connect the button between P8_07 (GPIO input) and P8_01 (GND). Find a functional description in section button.
Licence: GPLv3, Copyright 2017-2023 by Thomas{ doT ]Freiherr[ At ]gmx[ DoT }net
Run by: python button2.py
Definition in file button2.py.