paddyg wrote:Anthony, good. I hope the water being detected isn't anything catastrophic such as flood water entering your front door. Or if it is, that you never get that text message.
Code: Select all
#!/usr/bin/env python from time import sleep import os import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(23, GPIO.IN) state = GPIO.input(23) if (state == 0): print "Water detected!" else: print "Water not detected"