From 213ff6a65520d734e0424742e4226714b2619ec1 Mon Sep 17 00:00:00 2001 From: mandlm Date: Fri, 8 Jan 2016 10:14:36 +0100 Subject: [PATCH] configured button and dummy pin --- Moped/SwitchMopidy.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Moped/SwitchMopidy.py b/Moped/SwitchMopidy.py index 23684e7..465ff73 100755 --- a/Moped/SwitchMopidy.py +++ b/Moped/SwitchMopidy.py @@ -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)