from __future__ import print_function
import qwiic_gpio
import time
import sys
def runExample():
print("\nSparkFun Qwiic GPIO Example 1\n")
myGPIO = qwiic_gpio.QwiicGPIO()
if myGPIO.isConnected() == False:
print("The Qwiic GPIO isn't connected to the system. Please check your connection", \
file=sys.stderr)
return
myGPIO.begin()
myGPIO.mode_0 = myGPIO.GPIO_OUT
myGPIO.mode_1 = myGPIO.GPIO_OUT
myGPIO.mode_2 = myGPIO.GPIO_OUT
myGPIO.mode_3 = myGPIO.GPIO_OUT
myGPIO.mode_4 = myGPIO.GPIO_OUT
myGPIO.mode_5 = myGPIO.GPIO_OUT
myGPIO.mode_6 = myGPIO.GPIO_OUT
myGPIO.mode_7 = myGPIO.GPIO_OUT
myGPIO.setMode()
while True:
myGPIO.out_status_0 = myGPIO.GPIO_HI
myGPIO.out_status_1 = myGPIO.GPIO_HI
myGPIO.out_status_2 = myGPIO.GPIO_HI
myGPIO.out_status_3 = myGPIO.GPIO_HI
myGPIO.out_status_4 = myGPIO.GPIO_HI
myGPIO.out_status_5 = myGPIO.GPIO_HI
myGPIO.out_status_6 = myGPIO.GPIO_HI
myGPIO.out_status_7 = myGPIO.GPIO_HI
myGPIO.setGPIO()
print("set hi")
time.sleep(1)
myGPIO.out_status_0 = myGPIO.GPIO_LO
myGPIO.out_status_1 = myGPIO.GPIO_LO
myGPIO.out_status_2 = myGPIO.GPIO_LO
myGPIO.out_status_3 = myGPIO.GPIO_LO
myGPIO.out_status_4 = myGPIO.GPIO_LO
myGPIO.out_status_5 = myGPIO.GPIO_LO
myGPIO.out_status_6 = myGPIO.GPIO_LO
myGPIO.out_status_7 = myGPIO.GPIO_LO
myGPIO.setGPIO()
print("set lo")
time.sleep(1)
if __name__ == '__main__':
try: