diff options
author | Cody Hiar <codyfh@gmail.com> | 2018-05-12 18:50:17 -0600 |
---|---|---|
committer | Cody Hiar <codyfh@gmail.com> | 2018-05-12 18:50:17 -0600 |
commit | 58a1a961d79991641be5b9c3ccec2ef750085d8d (patch) | |
tree | 30f3b29cb92110ee0b391a8ea5e8203dcd465ec9 /moisture.py |
Initial commit
Diffstat (limited to 'moisture.py')
-rw-r--r-- | moisture.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/moisture.py b/moisture.py new file mode 100644 index 0000000..c393905 --- /dev/null +++ b/moisture.py @@ -0,0 +1,15 @@ +#!/usr/bin/python3 + +import time + +import RPi.GPIO as GPIO + +moisture_pin = 21 + +GPIO.setmode(GPIO.BCM) +GPIO.setup(moisture_pin, GPIO.IN) + +while True: + print(GPIO.input(moisture_pin)) + time.sleep(1) + |