runExample()
except (KeyboardInterrupt, SystemExit) as exErr:
print("\nEnding Example 1")
sys.exit(0)
Qwiic GPIO Example 2
Example 2 shows how to read each I/O pin when they are configured as inputs. It first sets up all pins using the
setMode
function as we did in Example 1. The code then monitors and prints out the status of each input every
0.25 seconds. You can copy the entire example below or open it from your downloaded copy of the Python
package: