Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save smoriarty21/cae434a206793211e16e0899f583d022 to your computer and use it in GitHub Desktop.
Save smoriarty21/cae434a206793211e16e0899f583d022 to your computer and use it in GitHub Desktop.
import RPi.GPIO as GPIO
# use P1 header pin numbering convention
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11, GPIO.IN)
input_value = GPIO.input(11)
if (input_value):
print 'Need to water'
else:
print 'No need for water I'm moist'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment