How to use the anyio.GPIO.input function in anyio

To help you get started, we’ve selected a few anyio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github whaleygeek / anyio / testHardware.py View on Github external
def loop():
  old_first  = False
  old_left   = False
  old_right  = False
  old_last   = False
  index = 0
  
  while True:
    # POLL BUTTONS
    # remember they are inverted
    first  = not GPIO.input(BUTTON_FIRST)
    left   = not GPIO.input(BUTTON_LEFT)
    right  = not GPIO.input(BUTTON_RIGHT)
    last   = not GPIO.input(BUTTON_LAST)
    
    # REPORT ANY CHANGED BUTTONS
    if first != old_first:
      print("FIRST=" + str(first))
      old_first = first
    if left != old_left:
      print("LEFT=" + str(left))
      old_left = left
    if right != old_right:
      print("RIGHT=" + str(right))
      old_right = right
    if last != old_last:
      print("LAST=" + str(last))
      old_last = last
github whaleygeek / anyio / testHardware.py View on Github external
def loop():
  old_first  = False
  old_left   = False
  old_right  = False
  old_last   = False
  index = 0
  
  while True:
    # POLL BUTTONS
    # remember they are inverted
    first  = not GPIO.input(BUTTON_FIRST)
    left   = not GPIO.input(BUTTON_LEFT)
    right  = not GPIO.input(BUTTON_RIGHT)
    last   = not GPIO.input(BUTTON_LAST)
    
    # REPORT ANY CHANGED BUTTONS
    if first != old_first:
      print("FIRST=" + str(first))
      old_first = first
    if left != old_left:
      print("LEFT=" + str(left))
      old_left = left
    if right != old_right:
      print("RIGHT=" + str(right))
      old_right = right
    if last != old_last:
      print("LAST=" + str(last))
github whaleygeek / anyio / testHardware.py View on Github external
def loop():
  old_first  = False
  old_left   = False
  old_right  = False
  old_last   = False
  index = 0
  
  while True:
    # POLL BUTTONS
    # remember they are inverted
    first  = not GPIO.input(BUTTON_FIRST)
    left   = not GPIO.input(BUTTON_LEFT)
    right  = not GPIO.input(BUTTON_RIGHT)
    last   = not GPIO.input(BUTTON_LAST)
    
    # REPORT ANY CHANGED BUTTONS
    if first != old_first:
      print("FIRST=" + str(first))
      old_first = first
    if left != old_left:
      print("LEFT=" + str(left))
      old_left = left
    if right != old_right:
      print("RIGHT=" + str(right))
      old_right = right
    if last != old_last:
      print("LAST=" + str(last))
      old_last = last