import serial
import io
import logging
+import RPi.GPIO as GPIO
PORT = 42001
DEFAULT_HOST = '127.0.0.1'
BUFFER_SIZE = 240 #used to be 100
SOCKET_TIMEOUT = 1
-DEVICES = ['/dev/ttyACM3']
+
+#DEVICES = ['/dev/ttyACM3']
#DEVICES = ['/dev/ttyACM0', '/dev/ttyACM1','/dev/ttyACM3']
-ARDUINO_BAUD_RATE = 9600
+#ARDUINO_BAUD_RATE = 9600
+
+#BROADCAST_NAMES = {'guitar': 'guitar',
+# 'drum': {0: 'cymbal',
+# 1: 'hihat',
+# 2: 'slowdrum',
+# 3: 'snare',
+# 4: 'tomtom'},
+# 'maracas': 'maracas'}
-BROADCAST_NAMES = {'guitar': 'guitar',
- 'drum': {0: 'cymbal',
- 1: 'hihat',
- 2: 'slowdrum',
- 3: 'snare',
- 4: 'tomtom'},
- 'maracas': 'maracas'}
+BROADCAST_NAMES = {
+ 17: 'maracas',
+ 18: 'maracas'}
SENSOR_NAMES = {'guitar': 'guitar_pitch'}
+GPIO.setmode(GPIO.BCM)
+for pin in BROADCAST_NAMES:
+ GPIO.setup(pin, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
+
+
logging.basicConfig(level = logging.INFO)
#logging.basicConfig(level = logging.DEBUG)