From ea73761744eee647caf88ebb7de986b844f0d7d2 Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Fri, 19 Apr 2013 20:06:59 +0100 Subject: [PATCH] Drums working, all put together --- arduino/drums.ino | 32 ------------------------------ raspberrypi/music-maker-handler.py | 2 +- 2 files changed, 1 insertion(+), 33 deletions(-) delete mode 100644 arduino/drums.ino diff --git a/arduino/drums.ino b/arduino/drums.ino deleted file mode 100644 index 4b3c18c..0000000 --- a/arduino/drums.ino +++ /dev/null @@ -1,32 +0,0 @@ - -#define THRESHOLD 64 -#define PADNUM 4 -#define PINLIMIT 500 - -int val; -int pinDelay; -int pinDelays[4] = { 0, 0, 0, 0 }; - -void setup() { - Serial.begin(57600); -} - -void loop() { - for(int i = 0; i < PADNUM; i++) { - val = analogRead(i); - pinDelay = pinDelays[i]; - - if(val >= THRESHOLD && pinDelay < 1) { - Serial.print(i); - Serial.print(","); - Serial.print(val); - Serial.println(); - pinDelays[i] = PINLIMIT; - } - - if (pinDelay > 0) { - pinDelays[i] = pinDelay - 1; - } - } -} - diff --git a/raspberrypi/music-maker-handler.py b/raspberrypi/music-maker-handler.py index 90cde8b..c935c15 100755 --- a/raspberrypi/music-maker-handler.py +++ b/raspberrypi/music-maker-handler.py @@ -18,7 +18,7 @@ PORT = 42001 DEFAULT_HOST = '127.0.0.1' BUFFER_SIZE = 240 #used to be 100 SOCKET_TIMEOUT = 1 -DEVICES = ['/dev/ttyACM2', '/dev/ttyACM3'] +DEVICES = ['/dev/ttyACM0', '/dev/ttyACM1','/dev/ttyACM3'] #DEVICES = ['/dev/ttyACM0','/dev/ttyACM1'] #DRUM_DEVICE = '/dev/ttyACM0' #GUITAR_DEVICE = '/dev/ttyUSB1' -- 2.34.1