configured button and dummy pin
parent
9f194a9a03
commit
213ff6a655
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/python
|
||||
#!/usr/bin/python
|
||||
|
||||
import glob
|
||||
import os
|
||||
|
@ -11,6 +11,9 @@ yellowLed = 15
|
|||
redLed = 17
|
||||
greenLed = 18
|
||||
|
||||
buttonPin = 27
|
||||
dummyPin = 1
|
||||
|
||||
mopidyConf = '/etc/mopidy/mopidy.conf'
|
||||
userDir = '/etc/mopidy/conf.user/'
|
||||
|
||||
|
@ -79,9 +82,6 @@ def buttonHandler(channel):
|
|||
print 'Error: ' + e.strerror
|
||||
|
||||
if __name__ == '__main__':
|
||||
buttonPin = 4
|
||||
dummyPin = 15
|
||||
|
||||
GPIO.setmode(GPIO.BCM)
|
||||
|
||||
GPIO.setup(yellowLed, GPIO.OUT)
|
||||
|
@ -93,6 +93,8 @@ if __name__ == '__main__':
|
|||
|
||||
GPIO.add_event_detect(buttonPin, GPIO.FALLING, callback=buttonHandler, bouncetime=1000)
|
||||
|
||||
setConfiguredLedColor()
|
||||
|
||||
try:
|
||||
while True:
|
||||
GPIO.wait_for_edge(dummyPin, GPIO.RISING)
|
||||
|
|
Loading…
Reference in New Issue