-
Notifications
You must be signed in to change notification settings - Fork 10
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
1 parent
7c62cd2
commit d214790
Showing
3 changed files
with
67 additions
and
31 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
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
"""Simple test class for testing relay.""" | ||
import RPi.GPIO as GPIO | ||
import time | ||
|
||
GPIO.setmode(GPIO.BCM) | ||
pins = [2, 3, 4, 17] | ||
for pin in pins: | ||
GPIO.setup(pin, GPIO.OUT) | ||
GPIO.output(pin, GPIO.HIGH) | ||
GPIO.setup(pin, GPIO.OUT) | ||
GPIO.output(pin, GPIO.HIGH) | ||
print("All pins set to high") | ||
while 1: | ||
inp = input("Enter pin number (2,3,4 or 17) and high or low: ") | ||
inpslit = inp.split(' ') | ||
to = GPIO.HIGH | ||
if inpslit[1] == 'low': | ||
to = GPIO.LOW | ||
GPIO.output(int(inpslit[0]),to) | ||
inp = input("Enter pin number (2,3,4 or 17) and high or low: ") | ||
inpslit = inp.split(' ') | ||
to = GPIO.HIGH | ||
if inpslit[1] == 'low': | ||
to = GPIO.LOW | ||
GPIO.output(int(inpslit[0]), to) |