Working automatic mode.No DB stuff yet.
This commit is contained in:
20
automatic/output.py
Normal file
20
automatic/output.py
Normal file
@@ -0,0 +1,20 @@
|
||||
#! env/bin/python3
|
||||
|
||||
import RPi.GPIO as GPIO
|
||||
import time
|
||||
from datetime import datetime
|
||||
|
||||
def write_pin_output(outputs):
|
||||
|
||||
# Setup for Hardware
|
||||
RELAY1_PIN = 26 # Water Pump
|
||||
RELAY2_PIN = 20 # Unassigned
|
||||
RELAY3_PIN = 21 # Lamp
|
||||
|
||||
# Write outputs.
|
||||
if outputs['detect']:
|
||||
time.sleep(1.0)
|
||||
|
||||
GPIO.output(RELAY1_PIN, outputs['pump'])
|
||||
GPIO.output(RELAY2_PIN, False)
|
||||
GPIO.output(RELAY3_PIN, outputs['lamp'])
|
||||
Reference in New Issue
Block a user