Theory and Practice of Tangible User Interfaces

Announcements

November 24, 2007
Reading for November 27th, are now posted. Enjoy!

October 2, 2007
To upload your thoughtless acts, create a new assignment page like any other lab. You'll see "Thoughtless Acts" listed as one of the assignment options.

May 24, 2008
This site has been archived and is no longer editable. Stay tuned for the next version, coming in the fall!

anologue flow

Project Members:
daniela

I modified the SinglePotControlsBrightness.txt and Control3LEDsWith3Pots.txt code to map rotational position to LEDs for use in the children's fortune teller oragami game. A person begins play by choosing a color (red, blue or green) and moving the fortune teller the number of letters of in the color's name.  Each move of the fortune teller changes the rotational position, changing the color of LEDs. The resulting color then determines the player's next number of moves, (three for red, four for blue, etc.). Thus, instead of using numbers drawn on the fortune teller to make the next move, the number of letters in each color are used to advance game play.

analogue fortune teller game

/*

* Daniela Rosner

* Modified one pot fades one led for fortune teller game

* by DojoDave <http://www.0j0.org>

*/

int potPin = 2; // select the input pin for the potentiometer

//int ledPin = 9; // select the pin for the LED

int val = 0; // variable to store the value coming from the sensor

int redLedPin = 9; // select the pins for the LEDs

int greenLedPin = 10;

int blueLedPin = 11;

void setup() {

Serial.begin(9600);

}

void loop() {

val = analogRead(potPin); // read the value from the sensor, between 0 - 1024

r = 0;

g = 0;

b = 0;

Serial.println(val);

if (val/4 < 80) {

r = 255;

} else if (val/4 < 160) {

g = 255;

} else {

b = 255;
}

analogWrite(redLedPin,r);
analogWrite(greenLedPin, g);
analogWrite(blueLedPin, b);
}