-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Eric George
committed
Feb 28, 2015
1 parent
5582233
commit 475cb04
Showing
7 changed files
with
42 additions
and
47 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#! /usr/bin/python | ||
import time | ||
import RPi.GPIO as GPIO | ||
from wsp_control.config import PIN | ||
|
||
GPIO.setwarnings(False) | ||
|
||
GPIO.setmode(GPIO.BCM) | ||
GPIO.setup(PIN.PUMP, GPIO.OUT) | ||
GPIO.setup(PIN.FLOW, GPIO.IN) | ||
|
||
def check(): | ||
if GPIO.input(PIN.PUMP): | ||
print 'Pump is on' | ||
else: | ||
print 'Pump is off' | ||
|
||
def toggle(): | ||
while True: | ||
print 'Switching', GPIO.input(PIN.PUMP) | ||
GPIO.output(PIN.PUMP, not GPIO.input(PIN.PUMP)) | ||
time.sleep(2) | ||
|
||
def override(): | ||
print 'Switching on' | ||
GPIO.output(PIN.PUMP, GPIO.HIGH) | ||
|
||
if GPIO.input(PIN.PUMP): | ||
print 'Pump is on' | ||
else: | ||
print 'Pump is off' | ||
|
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
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.