Aarnav Patel

Color-me-Out

The project aims to reimagine how we look at drawings as a more collaborative practice. On this drawing are three devices with their own distinct personalities reflecting how they compute color. The goal is that you slowly fill up this page with more color to be computed, creating a color-scape to be experienced through these devices. How can our drawings come together to make new adventures and stories.   

FINAL.mov

Very quick prototype video of it being used by kids during the actual show. 

Project Reflection

What did I expand upon: For the remainder of this project, I chose to expand on my initial flow project with quantity. I spent a lot of time with the code and the device form that I created a system of making the same devices over and over, so it would've been a missed opportunity to not try it. Additionally, because I wanted my project to be collaborative, having only one device would serve against it. Thus, I decided to make 2 more color sensors for the experience. HOWEVER, midway through, I realized that even thought my device and wires are the same, I could make an effort to change the software side andhow data is interpretted/translated to light despite the overall wiring being the same. This led to the change that each device would have their own way of interpretting the color data. This would make people want to explore each of the devices rather than an on/off experience. 

What was easy/hard: I think the easiest thing during the process was the replicating of the device – I was able to print the other 2 devices quite easily since I iterated enough with the first one to get it working. Additionally, I was organized and confident with the soldering that it was easy to recreate the boards, and then change the software of the output within the flow computer. The hardest part was probably debugging. Especially because I was simply copying a device that worked, it was especially boggling to see my replicas not working at times. I realized that I had been using the wrong pins for my old device (when attached the color sensor), and understanding the need to test the batteries... This was probably most stressful part of the process that I had to deal with, but ultimately made me most comfortable with debugging. 

Considerations for New Space: I think a big thing for my expansion was the presentation – I saw it as an opportunity for multiple people to gather to not just interact with the piece, but also each other. I printed out an extra long paper to cover two tables (10ft) and made shapes much larger for smoother transitions with color for the devices and get them to move it around the page more. I had to consider the world building behind my devices and give some context clues as to what the "personalities" behind each of these devices are, which led to my little platforms with clues as to how they react. 

I don't think my wall text appropriately showed the scope of my project, and realized that midway through the show I did have to repeat a lot of things to viewers to get them to appreciate the peice more – something I should've considered early on. I wish I could've done a bit more to make this piece "live on its own" rather than me needing to be there. There were also some unfortunate things of lighting and sound in the show that became distracting for my piece, so if I could've considered that earlier on that could've helped how I planned for this. 



Code:

Device 1

#include <Adafruit_TCS34725.h>

#include <Adafruit_NeoPixel.h>


// NeoPixel setup

#define PIN            13  // Define the pin for the NeoPixel strip

#define NUMPIXELS      30  // Define the number of NeoPixels in the strip


Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);


// TCS34725 setup

Adafruit_TCS34725 tcs = Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_50MS, TCS34725_GAIN_4X);


int numPixels = 30;

int illuminationLed = 9;

int breath = 51;

int increment = 1;


// Set to true if using a common anode LED

#define commonAnode true


byte gammatable[256];

byte invertedTable[256];


void setup() {

 Serial.begin(115200);

 pinMode(illuminationLed, OUTPUT);


 if (tcs.begin()) {

   // Serial.println("Found sensor");

 } else {

   Serial.println("No TCS34725 found ... check your connections");

   while (1); // halt!

 }


 // NeoPixel initialization

 strip.begin();

 strip.show();  // Initialize all pixels to 'off'


 // Gamma correction table

 for (int i = 0; i < 256; i++) {

   float x = i;

   x /= 255;

   x = pow(x, 2.5);

   x *= 255;

   gammatable[i] = x; //DO THIS!

   invertedTable[i] = 255-gammatable[i];

   }

}


void loop() {

 float red, green, blue;


 tcs.setInterrupt(false);  // turn on LED

 delay(60);  // takes 50ms to read

 tcs.getRGB(&red, &green, &blue);

 tcs.setInterrupt(true);  // turn off LED


 analogWrite(illuminationLed, 10);


 Serial.print("R:\t"); Serial.print(int(red));

 Serial.print("\tG:\t"); Serial.print(int(green));

 Serial.print("\tB:\t"); Serial.print(int(blue));

 Serial.print("\n");


   for (int i = 0; i < numPixels; i++) {

     strip.setBrightness(breath);

     strip.setPixelColor(i, strip.Color(

       gammatable[(int)red],

       gammatable[(int)green],

       gammatable[(int)blue]

     ));

   }


 // Example: Set the first NeoPixel color using gamma correction

 if (breath >= 255 || breath <= 50) {

   increment = -increment;

 }

 breath += increment;

 Serial.println(breath);


/*

   for (int i = 0; i < 10; i++) {

   strip.setPixelColor(i, strip.Color(

     red,

     green,

     blue

   ));

 }

 */



 strip.show();  // Send the updated color to the NeoPixel

}



Device 2:

#include <Adafruit_TCS34725.h>

#include <Adafruit_NeoPixel.h>


// NeoPixel setup

#define PIN            13  // Define the pin for the NeoPixel strip

#define NUMPIXELS      30  // Define the number of NeoPixels in the strip


Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);


// TCS34725 setup

Adafruit_TCS34725 tcs = Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_50MS, TCS34725_GAIN_4X);


int numPixels = 30;

int illuminationLed = 9;

int breath = 51;

int increment = 1;


// Set to true if using a common anode LED

#define commonAnode true


byte gammatable[256];

byte invertedGammatable[256];


void setup() {

 Serial.begin(115200);

 pinMode(illuminationLed, OUTPUT);


 if (tcs.begin()) {

   // Serial.println("Found sensor");

 } else {

   Serial.println("No TCS34725 found ... check your connections");

   while (1); // halt!

 }


 // NeoPixel initialization

 strip.begin();

 strip.show();  // Initialize all pixels to 'off'


 // Gamma correction table

 // Gamma correction table

 for (int i = 0; i < 256; i++) {

   float x = i;

   x /= 255;

   x = pow(x, 2.5);

   x *= 255;

   gammatable[i] = x; // Original gamma correction

   invertedGammatable[i] = 255 - gammatable[i]; // Inverted gamma correction

 }


}


void loop() {




 float red, green, blue;


 tcs.setInterrupt(false);  // turn on LED

 delay(60);  // takes 50ms to read

 tcs.getRGB(&red, &green, &blue);

 tcs.setInterrupt(true);  // turn off LED


 analogWrite(illuminationLed, 10);


 Serial.print("R:\t"); Serial.print(255 - int(red));

 Serial.print("\tG:\t"); Serial.print(255 - int(green));

 Serial.print("\tB:\t"); Serial.print(255 - int(blue));

 Serial.print("\n");


 // Example: Set the first NeoPixel color using gamma correction


 for (int i = 0; i < numPixels; i++) {

   strip.setBrightness(breath);

   strip.setPixelColor(i, strip.Color(

       gammatable[255 - int(red)],   // Adjust the red component

       gammatable[255 - int(green)],

       gammatable[255 - (int)blue]

   ));

 }

 if (breath >= 255 || breath <= 50) {

   increment = -increment;

 }

 breath += increment;

 Serial.println(breath);


/*

   for (int i = 0; i < 10; i++) {

   strip.setPixelColor(i, strip.Color(

     red,

     green,

     blue

   ));

 }

 */

   strip.show();  // Send the updated color to the NeoPixel


}




Device 3: 

#include <Adafruit_TCS34725.h>

#include <Adafruit_NeoPixel.h>


// NeoPixel setup

#define PIN            13  // Define the pin for the NeoPixel strip

#define NUMPIXELS      30  // Define the number of NeoPixels in the strip


Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);


// TCS34725 setup

Adafruit_TCS34725 tcs = Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_50MS, TCS34725_GAIN_4X);


int numPixels = 30;

int illuminationLed = 9;

int breath = 51;

int increment = 1;


// Set to true if using a common anode LED

#define commonAnode true


byte gammatable[256];

byte invertedTable[256];


void setup() {

 Serial.begin(115200);

 pinMode(illuminationLed, OUTPUT);


 if (tcs.begin()) {

   // Serial.println("Found sensor");

 } else {

   Serial.println("No TCS34725 found ... check your connections");

   while (1); // halt!

 }


 // NeoPixel initialization

 strip.begin();

 strip.show();  // Initialize all pixels to 'off'


 // Gamma correction table

 for (int i = 0; i < 256; i++) {

   float x = i;

   x /= 255;

   x = pow(x, 2.5);

   x *= 255;

   gammatable[i] = x; //DO THIS!

   invertedTable[i] = 255-gammatable[i];

   }

}


void loop() {

 float red, green, blue;


 tcs.setInterrupt(false);  // turn on LED

 delay(60);  // takes 50ms to read

 tcs.getRGB(&red, &green, &blue);

 tcs.setInterrupt(true);  // turn off LED


 analogWrite(illuminationLed, 10);


 Serial.print("R:\t"); Serial.print(int(red));

 Serial.print("\tG:\t"); Serial.print(int(green));

 Serial.print("\tB:\t"); Serial.print(int(blue));

 Serial.print("\n");


 if (int(red) < 80 && int(green) < 95 && int(blue) < 90) {

     for (int i = 0; i < numPixels; i++) {

     strip.setBrightness(breath);

     strip.setPixelColor(i, 255, 0, 0);

   }

 } else {

   for (int i = 0; i < numPixels; i++) {

     strip.setBrightness(breath);

     strip.setPixelColor(i, strip.Color(

       gammatable[(int)red],

       gammatable[(int)green],

       gammatable[(int)blue]

     ));

   }

 }


 // Example: Set the first NeoPixel color using gamma correction

 if (breath >= 255 || breath <= 50) {

   increment = -increment;

 }

 breath += increment;

 Serial.println(breath);


/*

   for (int i = 0; i < 10; i++) {

   strip.setPixelColor(i, strip.Color(

     red,

     green,

     blue

   ));

 }

 */



 strip.show();  // Send the updated color to the NeoPixel

}