Skip to content

Commit

Permalink
Auto pin setup
Browse files Browse the repository at this point in the history
-Now automatically sets all pins in a pattern to outputs.
  • Loading branch information
Scratchcat1 authored Oct 31, 2017
1 parent 49f0097 commit 7884490
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions AATC_GPIO.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,11 @@ def Pattern(Thread_Name, Pattern ,ReferenceTime=1,repeat = True):
pins.add(item[0])
try:
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11, GPIO.OUT) #red
GPIO.setup(13, GPIO.OUT) #amber
GPIO.setup(21, GPIO.OUT) #green
## GPIO.setup(11, GPIO.OUT) #red
## GPIO.setup(13, GPIO.OUT) #amber
## GPIO.setup(21, GPIO.OUT) #green
for pin in pins:
GPIO.setup(pin,GPIO.OUT)
#Pattern consists of a list with tuples of (Pin,State,WaitTime)
for Step in Pattern:
Pin = Step[0]
Expand Down

0 comments on commit 7884490

Please sign in to comment.