Team Colonial
Group Members: David Lackey, John O’Neill, Horia Radoi
Group Number: 7
Short Description
We built a physical interface (with potentiometers) to change the RGB values of a window filled with a single solid color. RGB values can be tricky to understand. Providing physical knobs to adjust them with immediate visual feedback allows the user to better grasp the concept of RGB values. We feel that our project was successful and we really liked how Processing allowed us to give such quick feedback. One of the main drawbacks of our project is that a user can only accurately control 2 potentiometers at a time, making it really difficult to affect all three RGB values simultaneously.
Sketches
RGB Interface
This sketch involves our physical interface for adjusting the RGB values of a solid color, displayed via laptop.
Cup Temperature Indicator
This sketch involves an LED setup mounted on the side of a cup. A thermistor hangs just barely into the cup through a small hole in the lid. The information from the temperature sensor is passed to the Arduino, which then powers certain LEDs based on the temperature of the inside of the cup.
Rooster
This sketch involves a Photo Sensor attached to a window to get information about the lighting outside of the user’s room. If the light outside reaches a certain threshold (daylight), a buzzer connected to the Arduino will go off, waking the user.
Storyboard
System in Action
THE RGB PANEL (video)
Parts Used
- Arduino, wires, USB cord, breadboard
- 3 Rotary Potentiometers
Creation Instructions
- Add three rotary potentiometers to a breadboard
- Add power to the rotary potentiometers, connect them to ground, and connect each one to a separate analog input
- Read potentiometer values and convert them to RGB values
- Use Processing to display a window filled with a solid color
Source Code
Arduino
/* RGBKnobs */ // pins for knobs int rPin = 0; int gPin = 1; int bPin = 2; // the analog reading from the knobs int rReading; int gReading; int bReading; double knobMax = 1023.0; void setup(void) { // We'll send debugging information via the Serial monitor Serial.begin(9600); } void loop(void) { rReading = 255 - (255 * (analogRead(rPin) / knobMax)); gReading = 255 - (255 * (analogRead(gPin) / knobMax)); bReading = 255 - (255 * (analogRead(bPin) / knobMax)); Serial.print(rReading); Serial.print(","); Serial.print(gReading); Serial.print(","); Serial.print(bReading); Serial.println(); }
Processing
/* RGB Knobs, created by Lab Group 7 (jconeill, dlackey, hradoi) */ import processing.serial.*; Serial port; // rgb values int[] vals = {0,0,0}; void setup() { size(555, 555); println("Available serial ports:"); println(Serial.list()); port = new Serial(this, Serial.list()[4], 9600); port.bufferUntil('\n'); } void draw() { background(vals[0], vals[1], vals[2]); } void serialEvent(Serial port) { String in = port.readStringUntil('\n'); in = trim(in); if (in != null) vals = int(split(in, ",")); }