diff --git a/Arduino Uno/.DS_Store b/Arduino Uno/.DS_Store old mode 100644 new mode 100755 index 5008ddf..644580e Binary files a/Arduino Uno/.DS_Store and b/Arduino Uno/.DS_Store differ diff --git a/Arduino Uno/arduino_monome/arduino_monome.ino b/Arduino Uno/arduino_monome/arduino_monome.ino old mode 100644 new mode 100755 diff --git a/Arduino Uno/arduino_monome/settings.h b/Arduino Uno/arduino_monome/settings.h old mode 100644 new mode 100755 diff --git a/Arduino Uno/simple_arduino_monome/settings.h b/Arduino Uno/simple_arduino_monome/settings.h old mode 100644 new mode 100755 diff --git a/Arduino Uno/simple_arduino_monome/simple_arduino_monome.ino b/Arduino Uno/simple_arduino_monome/simple_arduino_monome.ino old mode 100644 new mode 100755 diff --git a/MaKey MaKey/.DS_Store b/MaKey MaKey/.DS_Store old mode 100644 new mode 100755 index 9e6b87b..47ea2f6 Binary files a/MaKey MaKey/.DS_Store and b/MaKey MaKey/.DS_Store differ diff --git a/MaKey MaKey/README.md b/MaKey MaKey/README.md old mode 100644 new mode 100755 index db5f961..630c48d --- a/MaKey MaKey/README.md +++ b/MaKey MaKey/README.md @@ -1,10 +1,26 @@ Makey Makey Monome ============== +Original Project: Jenna deBoisblanc
2014
[jdeboi.com](http://jdeboi.com/makey-makey-monome/) +Updated Project:
+David Cool
+http://davidcool.com
+http://generactive.net
+http://mystic.codes
+December 2015
+ +Arduino Updates: +- Added rainbow loop when no serial data is detected +- Changed initialization to R / G / B color wipe +- Added a button reset to loop (fixes buttons left on when exiting processing) + +TODO: +- Figure out big lag when "waking" from rainbow loop when serial is detected (use interrupts?) + **Objective**: Build an uber kid-friendly monome (a complex electronic music instrument).
diff --git a/MaKey MaKey/complete/.DS_Store b/MaKey MaKey/complete/.DS_Store old mode 100644 new mode 100755 diff --git a/MaKey MaKey/complete/README.md b/MaKey MaKey/complete/README.md old mode 100644 new mode 100755 index 454cad2..f290cc7 --- a/MaKey MaKey/complete/README.md +++ b/MaKey MaKey/complete/README.md @@ -1,10 +1,26 @@ (complete) Makey Makey Monome ============== +Original Project: Jenna deBoisblanc
2014
[jdeboi.com](http://jdeboi.com/makey-makey-monome/) +Updated Project: +David Cool +http://davidcool.com +http://generactive.net +http://mystic.codes +December 2015 + +Arduino Updates: +- Added rainbow loop when no serial data is detected +- Changed initialization to R / G / B color wipe +- Added a button reset to loop (fixes buttons left on when exiting processing) + +TODO: +- Figure out big lag when "waking" from rainbow loop when serial is detected (use interrupts?) + **Overview:** All the files you need to build an RBG LED backlit touchscreen MaKey MaKey Monome that interfaces with Processing - an elegant, complex visual programming language.
diff --git a/MaKey MaKey/complete/makey_makey_monome/makey_makey_monome.ino b/MaKey MaKey/complete/makey_makey_monome/makey_makey_monome.ino index f4b8d77..fd51278 100644 --- a/MaKey MaKey/complete/makey_makey_monome/makey_makey_monome.ino +++ b/MaKey MaKey/complete/makey_makey_monome/makey_makey_monome.ino @@ -1,13 +1,26 @@ /* ************************************************ - ********** MAKEY MAKEY PAPER MONOME ************ + ************* MAKEY MAKEY MONOME *************** ************************************************ - //MAKER//////////// + //ORIGINAL MAKER//////////// Jenna deBoisblanc http://jdeboi.com start date: January 2014 - Instructable: - GitHub repo: + + //UPDATED MAKER//////////// + David Cool + http://davidcool.com + http://generactive.net + http://mystic.codes + December 2015 + + Updates: + - Added rainbow loop when no serial data is detected + - Changed initialization to R / G / B color wipe + - Added a button reset to loop (fixes buttons left on when exiting processing) + + TODO: + - Figure out big lag when "waking" from rainbow loop when serial is detected //DESCRIPTION////// My objective for this project was to build a monome- http://monome.org/ - @@ -59,7 +72,7 @@ #define NUM_BUTTONS NUM_ROWS * NUM_COLUMNS // 64 buttons #define TARGET_LOOP_TIME 744 // (1/56 seconds) / 24 samples = 744 microseconds per sample -#define SERIAL9600 +#define SERIAL57600 #include "settings.h" ///////////////////////// @@ -111,6 +124,7 @@ int pressThreshold; int releaseThreshold; int triggerThresh = 200; boolean inputChanged; +int count = 0; /* @@ -180,9 +194,9 @@ void updateNeopixels(); ////////////////////// void setup() { + initializeNeopixels(); initializeArduino(); initializeInputs(); - initializeNeopixels(); delay(100); } @@ -191,6 +205,7 @@ void setup() //////////////////// void loop() { + if (Serial) { checkSerialInput(); updateMeasurementBuffers(); updateBufferSums(); @@ -198,14 +213,23 @@ void loop() updateInputStates(); updateOutLED(); addDelay(); + count = 1; + } else { + if (count == 1) { + clearMonome(); + count = 0; + } + rainbow(100); + } } ////////////////////////// // INITIALIZE ARDUINO ////////////////////////// void initializeArduino() { - Serial.begin(9600); + Serial.begin(57600); while (!Serial) { + rainbow(100); ; // wait for serial port to connect. Needed for Leonardo only } /* Set up input pins @@ -262,7 +286,7 @@ void initializeInputs() { } } -void checkSerialInput() { +int checkSerialInput() { /* here is what the incoming serial data means 0 => no incoming serial data @@ -301,9 +325,12 @@ void checkSerialInput() { void initializeNeopixels() { strip.begin(); strip.show(); // Initialize all pixels to 'off' - rainbow(20); + colorWipe(strip.Color(255, 0, 0), 20); // Red + colorWipe(strip.Color(0, 255, 0), 20); // Green + colorWipe(strip.Color(0, 0, 255), 20); // Blue clearNeopixels(); setColors(); + delay(1000); } @@ -425,7 +452,7 @@ void updateMonome() { if(!buttons[index].state) { buttons[index].state = true; updateNeopixels(); -#ifdef SERIAL9600 +#ifdef SERIAL57600 // add 1 to differentiate index from 0 bytes of serial data Serial.write(index+1); #endif @@ -438,7 +465,7 @@ void updateMonome() { else { buttons[index].state = false; updateNeopixels(); -#ifdef SERIAL9600 +#ifdef SERIAL57600 Serial.write(index+1+NUM_BUTTONS); #endif #ifdef DEBUG_MONOME @@ -601,10 +628,19 @@ void rainbow(uint8_t wait) { } } +// Fill the dots one after the other with a color +void colorWipe(uint32_t c, uint8_t wait) { + for(uint16_t i=0; i 0 && myPort.available() > 0) { // If data is available + if (count == 0) { + count++; + } + val = myPort.read(); // read it and store it in val - /* we add 1 to the button index value on the Arduino + /* + We add 1 to the button index value on the Arduino so that we can differentiate from a null serial transmission - We add numButtons to the index to indicate that the button is turning off + We add numButtons to the index to indicate that the button is turning off */ - //if(val < (numButtons*2+1)) { - if (val > numButtons) buttons[val-(numButtons+1)].switchOff(); - else if (val > 0) {buttons[val-1].switchOn(); println("off");} - //} - //else text("confused", 10, 20); - // TODO - WHAT? shouldn't this be (button#), not (val)?? - // recordButton(val); + if (val > numButtons) { + buttons[val-(numButtons+1)].switchOff(); + recordButton(val-(numButtons+1)); + // send on/off info to console + println("off"); + println("val: " + val); + println(); + } + else if (val > 0) { + buttons[val-1].switchOn(); + recordButton(val-1); + // send on/off info to console + println("on"); + println("val: " + (val)); + println(); + } } } @@ -258,6 +294,15 @@ void checkButtonClick() { buttons[i].switchState(); recordButton(i); sendToMonome(i); + //send on/off info to console + if (buttons[i].state) { + println("on"); + println("val: " + (i + 1)); + } else { + println("off"); + println("val: " + ((i + 1) + numButtons)); + } + println(); } } } @@ -292,7 +337,9 @@ void recordButton(int button) { if (buttons[button].state) val = button+1; else val = button + numButtons+1; timeTriggered = append(timeTriggered, millis() - startTime); + println("time: " + (millis() - startTime)); buttonTriggered = append(buttonTriggered, val); + //println("button: " + val); } } @@ -325,6 +372,7 @@ void saveRecording() { String[] lines = new String[timeTriggered.length]; for (int i = 0; i < timeTriggered.length; i++) { lines[i] = timeTriggered[i] + "\t" + buttonTriggered[i]; + println(lines[i]); } String fileName = "files/file" + fileIndex + ".txt"; saveStrings(fileName, lines); @@ -527,8 +575,8 @@ void getSerialPort(){ int y0 = 50; fill(0); text("Select serial port:", x, 30); - Button[] setupButtons = new Button[ports.length+1]; - for(i = 0; i < ports.length; i++){ + Button[] setupButtons = new Button[(ports.length/2)+1]; + for(i = 0; i < (ports.length/2); i++){ setupButtons[i] = new Button(i, x, 30*i+y0, 20, 20); fill(0); text(ports[i], x+30, 30*i+y0+15); @@ -542,12 +590,12 @@ void getSerialPort(){ button.state = true; button.highlight = true; if(mousePressed) { - if( button.n == ports.length ){ + if( button.n == (ports.length/2) ){ useSerial = 0; return; } else { useSerial = button.n; - myPort = new Serial(this, ports[button.n], 9600); + myPort = new Serial(this, ports[button.n], 57600); return; } } @@ -567,11 +615,13 @@ void loadSounds() { minim = new Minim(this); sounds = new AudioSample[numRows]; // load sounds - filename, buffer size + //print("Loading sounds: "); for(int i=0; i 2014
[jdeboi.com](http://jdeboi.com/makey-makey-monome/) +Updated Project:
+David Cool
+http://davidcool.com
+http://generactive.net
+http://mystic.codes
+December 2015
+ +Processing Updates: +- Fixed recording feature so it works with Processing sketch & monome interaction +- Fixed bug where first monome button press wouldn't register +- Fixed bug where serial selection list would have double entries +- Changed button colors on screen and changed to matching colors on monome + +TODO: +- Would love to add toggle for multiple 8 instrument screens so you could layer samples + +Arduino Updates: +- Added rainbow loop when no serial data is detected +- Changed initialization to R / G / B color wipe +- Added a button reset to loop (fixes buttons left on when exiting processing) + +TODO: +- Figure out big lag when "waking" from rainbow loop when serial is detected (use interrupts?) + **Objective**: Build an uber kid-friendly monome (a complex electronic music instrument).