configured button and dummy pin

This commit is contained in:
mandlm 2016-01-08 10:14:36 +01:00
parent 9f194a9a03
commit 213ff6a655

View file

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