Created
May 31, 2017 02:26
-
-
Save smoriarty21/b4e392fceced667731146a17de2c0b92 to your computer and use it in GitHub Desktop.
GPIO Read
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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