Use TCS34725 to read the different colors, and use processing to play different notes according to the values. ** Add the data file consisting the soundbank-deluxe.gm with your processing file. ** The file: soundbank-deluxe.gm can be found: http://www.oracle.com/technetwork/java/soundbanks-135798.html * Arduino Code is revised from Adafruit's Flora_Pianoglove example.

(The VCNL400 also comes with a light sensor, but for now, we are going to only deal with the proximity sensor.)The range of this sensor is 200mm, which is about 7.874 inches. We lined the range to find the approximate values given by the sensor to change the brightness of the light and to find a point to turn on the siren! The siren is running on processing. ** Add the data file consisting the soundbank-deluxe.gm with your processing file. ** The file: soundbank-deluxe.gm can be found: http://www.oracle.com/technetwork/java/soundbanks-135798.html

This time, processing is going to act as an input, not the output. We will use the Arduino to hook up all the things, but the servo connected will react to the input by the processing. *** Before uploading this code on Processing, upload the StandardFirmata under Examples -> Firmata.

Processing Code 01 with the mouse (directly from an example):

/*library: http://arduino.cc/en/Reference/Servo*/

import processing.serial.*;

import cc.arduino.*;

Arduino arduino;

voidsetup() {size(360, 200);// Prints out the available serial ports.println(Arduino.list()); // Modify this line, by changing the index of the serial // port corresponding to your Arduino board (as it appears in the list // printed by the line above). arduino = new Arduino(this, Arduino.list()[4], 57600); // Alternatively, use the name of the serial port corresponding to your // Arduino (in double-quotes), as in the following line. //arduino = new Arduino(this, "/dev/tty.usbmodem621", 57600);