Multi-color LED control

Description

I used an Arduino to control three LED’s: red, green, and blue. With pulse width modification, I control the brightness of each. They are all under a plastic container that has been covered with a couple layers of bubble wrap to act as a diffuser. The brightness of each can be controlled by using serial communication sending combinations of the letters “r”, “g”, and “b”. For example, “rrrrrbbbb” will result in a purple light.

Components

  • Arduino
  • 3 LED’s: red, green, blue
  • 3 Resistors (220Ω)
  • 5 Wires
  • 1 Breadboard
  • 1 Plastic storage container
  • Bubble wrap

Code

 

char serInString[100]; // array that will hold the different bytes of the string. 100=100characters;
// -> you must state how long the array will be else it won't work properly
char colorCode;
int colorVal;
int redVal;
int greenVal;
int blueVal;
int redPin = 9; // Red LED, connected to digital pin 9
int greenPin = 10; // Green LED, connected to digital pin 10
int bluePin = 11; // Blue LED, connected to digital pin 11
void setup() {
pinMode(redPin, OUTPUT); // sets the pins as output
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
Serial.begin(9600);
analogWrite(redPin, 127); // set them all to mid brightness
analogWrite(greenPin, 127); // set them all to mid brightness
analogWrite(bluePin, 127); // set them all to mid brightness
Serial.println("enter color command using r's, b's, and g's (e.g. 'rrrrrrggggg') :");
}
void loop () {
// clear the string
memset(serInString, 0, 100);
//read the serial port and create a string out of what you read
readSerialString(serInString);
// initialize all back to zero for each loop
redVal = 0;
greenVal = 0;
blueVal = 0;
colorCode = serInString[0];
if( colorCode == 'r' || colorCode == 'g' || colorCode == 'b' ) {
// increment each color based on number of each letter
for (int i = 0; i < strlen(serInString); i++) { switch(serInString[i]) { case 'r': redVal += 25; break; case 'g': greenVal += 25; break; case 'b': blueVal += 25; break; } } Serial.print("Setting color "); Serial.println(); Serial.print("red to "); Serial.print(redVal); Serial.println(); Serial.print("green to "); Serial.print(greenVal); Serial.println(); Serial.print("blue to "); Serial.print(blueVal); Serial.println(); serInString[0] = 0; // indicates we've used this string analogWrite(redPin, redVal); analogWrite(greenPin, greenVal); analogWrite(bluePin, blueVal); } delay(100); // wait a bit, for serial data } //read a string from the serial and store it in an array //you must supply the array variable void readSerialString (char *strArray) { int i = 0; if(!Serial.available()) { return; } while (Serial.available()) { strArray[i] = Serial.read(); i++; } }

LED color controller

Diagramming with both hands

My computing experience that came closest to fully utilizing my hands was working in OmniGraffle while using both a mouse and a MacBook Pro trackpad. OmniGraffle, a diagramming software application, was probably never intended to be used with both a mouse and a trackpad. However, both panning and zooming require holding extra keys while moving the mouse. Instead, I end up using one hand to pan with the trackpad while the other hand zooms and manipulates objects with the mouse.

This works well for moving around a canvas, but fails to add feedback when working on an item. The newest MacBook Pros have haptic feedback used to give a clicking sensation, but this could be used to give other feedback. A similar feature would be needed in the mouse, and is now available from some gaming mice. Using these controls, it would be possible to give force feedback when items in a design are properly aligned, complementing the existing visual cues. Tactile feedback has been available for mobile devices for a long time, but tactile feedback in mice has never become a feature with enough hardware or software support.

Sketch, a similar software which has made extensions easy to build, could probably have an extension written to add this force feedback. Now I just need an expensive mouse and time to program the extension.

Variable blinking light

Description


I used an Arduino with a red light. I changed the code to have a variable rate of blinking moving back and forth between a delay of 100 to 500 milliseconds. I tested it and saw the change.

Components


  • 1 Arduino
  • 1 LED
  • 1 Resistor (220Ω)
  • 1 Breadboard
  • 3 Wires

Code


int ledPin = 13;
int currentRate = 1000;
int rateDir = 0;
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin 13 as an output.
pinMode(ledPin, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
if (currentRate > 500) {
rateDir = 0;
} else if (currentRate < 100) {
rateDir = 1;
}
if (rateDir == 1) {
currentRate = currentRate + 50;
} else {
currentRate = currentRate - 50;
}
digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(currentRate); // wait for current delay
digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW
delay(currentRate); // wait for current delay
}

IMG_20160831_151457

A kid’s favorite UI- a Game Boy Advance

As a kid, my favorite UI was my Game Boy Advance. It was my companion on long car rides for many years of family vacations. The handheld size was the only size that allowed me to play in the back seat of a car, and the long battery life made it possible to play for hours (Dourish 19). Unlike a tangible UI that would connect me to the world, it acted as an escape from reality (Dourish 37). I would become so engrossed in games that I would not get motion sickness on windy roads. The technical features made it possible to use in a situation where no other UI would work.

The look and feel also contributed to my love of my Game Boy. The back was shaped to make it clear where to place my hands so my fingers could use all 8 buttons (Dourish 52). The comfort let me forget about any physical limitations. Even the exterior plastic color was important. The color (named “Glacier”) was a translucent blue that made all the internal components visible. As a kid who had received an electronics kit for Christmas the previous year, I was excited to see push-button switches that I recognized from my kit. I had a sense that someday I could understand every component I saw underneath the skin of my Game Boy (Kaptelinin 22). With my Game Boy, I could both escape the world and hope for a future where I could control every detail of my games.