Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save smoriarty21/b4e392fceced667731146a17de2c0b92 to your computer and use it in GitHub Desktop.
Save smoriarty21/b4e392fceced667731146a17de2c0b92 to your computer and use it in GitHub Desktop.
GPIO Read
import Adafruit_BBIO.GPIO as GPIO
def main():
GPIO.setup("P8_7", GPIO.IN)
if GPIO.input("P8_7"):
print("Dry, water me!")
else:
print("Moist, no need for water")
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment