Simplified glove.py
authorPi user <pi@njae.me.uk>
Mon, 21 Oct 2013 12:50:23 +0000 (13:50 +0100)
committerPi user <pi@njae.me.uk>
Mon, 21 Oct 2013 12:50:23 +0000 (13:50 +0100)
glove.py

index 5208c84d1a2aed2f42e4a53a2bdf8fb6fe19f921..942d83bb0b1b7bfb0e3fd65bed58cbf284f5cddc 100644 (file)
--- a/glove.py
+++ b/glove.py
@@ -1,16 +1,5 @@
 import pygame
 import RPi.GPIO as gpio
-import time
-import logging
-
-logger = logging.getLogger(__name__)
-loggerFileHandler = logging.FileHandler('glove.log')
-loggerFileHandlerFormatter = logging.Formatter('%(asctime)s %(levelname)-8s  %(message)s')
-loggerFileHandler.setFormatter(loggerFileHandlerFormatter)
-logger.addHandler(loggerFileHandler)
-logger.setLevel(logging.WARNING)
-logger.setLevel(logging.INFO)
-
 
 guitars = ['sounds/guitar1.wav',
            'sounds/guitar2.wav',
@@ -24,14 +13,11 @@ sounds = [pygame.mixer.Sound(g) for g in guitars]
 def handle_sound(pin):
     if not gpio.input(pin):
         sounds[pins.index(pin)].play()
-        logger.info("Started playing {0}".format(pins.index(pin)))
     else:
         sounds[pins.index(pin)].stop()
-        logger.info("Stopped playing {0}".format(pins.index(pin)))
 
 gpio.setmode(gpio.BCM)
 pins = [25, 24, 18, 22]
-# pins = [25]
 
 for pin in pins:
     gpio.setup(pin, gpio.IN)