Making Things Interactive

March 20, 2008

States

Filed under: 8: State Machine, Lea — tovelet @ 1:57 pm

A booth game, for Carnival:

www.contrib.andrew.cmu.edu/~lea/state.pdf

Digital Book state diagram

Filed under: 8: State Machine, Assignments, Nadeem Haidary — nhaidary @ 1:56 pm

This is a digital book reader. When the front cover is opened, a photosensor reads HIGH to display the title page. The page is attached to a motor, which in this case is used backwards as a generator and switch. When the page is turned, it rotates the motor, causing an input pin to read HIGH and provide electricity to generate the next page’s text on a digital ink display. Everytime you turn the page 360 degrees, you generate a new page, so it simulates turning the pages of an analog book. The text (which in my case will be displayed in Processing) has a feature to save a section of the page as an image in the margin by drawing a box around it. You can view that image full-screen by clicking on it in the margin.

book state diagram

Making Louvers smart!

Filed under: 8: State Machine, Brian Kish — bkish @ 1:31 pm

Please check out the PDF for my State Machine :)

Smart Louver Diagram

State Machine: Garmin

Filed under: 8: State Machine, Assignments, Thomas Hendrickson — tphendrickson @ 12:27 pm

I did a state machine for my garmin, which is just a car GPS device thing.

8: ‘Simon’ State Diagram

Filed under: 8: State Machine, Luis Castellanos, Students — lcc1006 @ 12:16 pm
Tags: , ,

This is a game i want to implement for Booth, a touch sensor notices when a new player has arrived and commences the game by turning off all the lights (so the LED’s stand out more). Then the game goes on like in the state diagram.

State Diagram

Simple Accelerometer Toy

Filed under: 8: State Machine, Assignments, Christopher Bridgman — cbridgma @ 11:34 am

So my idea for this state machine is to build a simple toy that uses an accelerometer to gauge how violently a toy is being played with. The idea is that, after you turn the toy on, the toy will go into attract mode, where it will blink an LED. Then, when the accelerometer senses movement, it will go into play mode, blinking multiple LED’s. Now the fun part is, if you shake the toy too violently and the accelerometer crosses a thresh hold, then an alarm will go off signaling the user to put the toy down or slow down. It is a simple idea, but i wanted to further explore an accelerometer while using analog input instead of digital input.

Accelerometer Toy State Machine Diagram

State Machine Assignment

Filed under: 8: State Machine, Cat Adams — catadams @ 11:20 am

The state machine I have designed is the interaction component between my final project (the automatic recycler) and the user. The recycler rewards depending upon how many people have used the recycler that day (implementing counting), or chides the user if they do not recycle.

fsm.pdf

assignment 8: Personal Medication Tracker

Filed under: 8: State Machine, Assignments, Gee Kim — gskim @ 3:15 am

The state machine here shows how my Personal Medication Tracker works. This device is a tool that helps keep track of medication intake. So it begins by waiting for a patient. Once a patient stands on a mat (with a button sensor beneath it), the device recognizes that a patient is standing there, and prints onto the screen “Personal Medication Tracker, Name:, and Date:” Then it begins by asking a yes or no question on the screen, the answer would print onto the screen following the question. Then there is a delay until it is time to take the next medication. Then the next question is asked, and the answer in printed. Another delay until it is time to take the last medication. Then the last question is asked, and the answer is printed.

This information can be printed for the patient’s reference. There is also space for the patient to fill out their name and date.

(To refresh the device for the next day, simply press the refresh button on the arduino.)

medication-tracker-diagram.jpg


int switch1 = 5;  // patient sensor
int switch2 = 3;  // "yes" button
int switch3 = 6;  // "no" button
int led1 = 2;     // morning pill 1
int led2 = 1;     // morning pill 2
int led3 = 4;     // afternoon pill 1
int led4 = 7;     // dinner pill 1
int led5 = 8;     // dinner pill 2

void setup ()
{
  pinMode (switch1, INPUT);
  pinMode (switch2, INPUT);
  pinMode (switch3, INPUT);
  pinMode (led1, OUTPUT);
  pinMode (led2, OUTPUT);
  pinMode (led3, OUTPUT);
  pinMode (led4, OUTPUT);
  pinMode (led5, OUTPUT);
  Serial.begin (9600);
}

void loop ()
{
  if (digitalRead(switch1==HIGH)){
    {
      Serial.println ("Personal Medication Tracker");
      Serial.println ("Name:");
      Serial.println ("Date:");
      Serial.println ("");
      Serial.println ("Did you take your morning pills?");
      YESorNOmorning ();
      Serial.println ("Did you take your afternoon pills?");
      YESorNOafternoon ();
      Serial.println ("Did you take your night pills?");
      YESorNOnight ();
    }
  }
}

void YESorNOmorning ()
{
  delay (5000);
  if (digitalRead(switch2==HIGH))
  {
    digitalWrite(led1,HIGH);
    digitalWrite(led2,HIGH);
    Serial.println ("YES");
    Serial.println ("");
   }
   if (digitalRead(switch3==HIGH))
   {
     digitalWrite(led1,LOW);
     digitalWrite(led2,LOW);
     Serial.println ("NO");
     Serial.println ("");
    }
     delay(5000);
}

void YESorNOafternoon ()
{
  delay (1000);
  if (digitalRead(switch2==HIGH))
  {
    digitalWrite(led3,HIGH);
    Serial.println ("YES");
    Serial.println ("");
   }
   if (digitalRead(switch3==HIGH))
   {
     digitalWrite(led3,LOW);
     Serial.println ("NO");
     Serial.println ("");
    }
     delay(5000);
}

void YESorNOnight ()
{
  delay (1000);
  if (digitalRead(switch2==HIGH))
  {
    digitalWrite(led4,HIGH);
    digitalWrite(led5,HIGH);
    Serial.println ("YES");
    Serial.println ("");
   }
   if (digitalRead(switch3==HIGH))
   {
     digitalWrite(led4,LOW);
     digitalWrite(led5,LOW);
     Serial.println ("NO");
     Serial.println ("");
   }
   delay(5000);
}


revised code


int switch1 = 5;  // patient sensor
int switch2 = 3;  // "yes" button
int switch3 = 6;  // "no" button
int led1 = 2;     // morning pill 1
int led2 = 1;     // morning pill 2
int led3 = 4;     // afternoon pill 1
int led4 = 7;     // dinner pill 1
int led5 = 8;     // dinner pill 2

void setup ()
{
  pinMode (switch1, INPUT);
  pinMode (switch2, INPUT);
  pinMode (switch3, INPUT);
  pinMode (led1, OUTPUT);
  pinMode (led2, OUTPUT);
  pinMode (led3, OUTPUT);
  pinMode (led4, OUTPUT);
  pinMode (led5, OUTPUT);
  Serial.begin (9600);
}

void loop ()
{
  if (digitalRead(switch1==HIGH)){  // start machine at 8:00 am
    {                               //
      Serial.println ("Personal Medication Tracker");
      Serial.println ("Name:");     //
      Serial.println ("Date:");     //
      Serial.println ("");          //
      Serial.println ("Did you take your morning pills?");
      YESorNOmorning ();            //
      delay (14400000);             // 12:00pm
      Serial.println ("Did you take your afternoon pills?");
      YESorNOafternoon ();          //
      delay (21600000);             // 6:00pm
      Serial.println ("Did you take your night pills?");
      YESorNOnight ();              //
      delay (50400000);             // 8:00am

    }
  }
}

void YESorNOmorning ()              // when it's morning
{
  delay (5000);                     // delay 5 seconds
  if (digitalRead(switch2==HIGH))   // when "yes" button is pressed
  {
    digitalWrite(led1,HIGH);        // morning medicine 1 taken, led goes on
    digitalWrite(led2,HIGH);        // morning medicine 2 taken, led goes on
    Serial.println ("YES");         // print "yes"
    Serial.println ("");
   }
   if (digitalRead(switch3==HIGH))  // when "no" button is pressed
   {
     digitalWrite(led1,LOW);        // morning medicine 1 not taken, led stays off
     digitalWrite(led2,LOW);        // morning medicine 2 not taken, led stays off
     Serial.println ("NO");         // print "no"
     Serial.println ("");
    }
     delay(5000);                   // delay 5 seconds
}

void YESorNOafternoon ()           // when it's afternoon
{
  delay (5000);                    // delay 5 seconds
  if (digitalRead(switch2==HIGH))  // when "yes" button is pressed
  {
    digitalWrite(led3,HIGH);       // morning afternoon medicine 1 taken, led goes on
    Serial.println ("YES");        // print "yes"
    Serial.println ("");
   }
  if (digitalRead(switch3==HIGH))  // when "no" button is pressed
   {
     digitalWrite(led3,LOW);       // afternoon medicine 1 not taken, led stays off
     Serial.println ("NO");        // print "no"
     Serial.println ("");
    }
     delay(5000);                  // delay 5 seconds
}

void YESorNOnight ()               // when night
{
  delay (1000);
  if (digitalRead(switch2==HIGH))  // when "yes" button is pressed
  {
    digitalWrite(led4,HIGH);       // night medicine 1 taken, led goes on
    digitalWrite(led5,HIGH);       // night medicine 2 taken, led goes on
    Serial.println ("YES");        // print "yes"
    Serial.println ("");
   }
   if (digitalRead(switch3==HIGH)) // when "no" button is pressed
   {
     digitalWrite(led4,LOW);       // night medicine 1 not taken, led stays off
     digitalWrite(led5,LOW);       // night medicine 2 not taken, led stays off
     Serial.println ("NO");        // print "no"
     Serial.println ("");
   }
   delay(5000);                    // delay 5 seconds
}
//

Wash Your Hands

Filed under: 8: State Machine, Gaku Sato — ponkotsu @ 2:15 am

Indeed, wash your hands.  I secretly hate when people don’t wash their hands, so this is a system that would automatically engage a door lock if you try to leave the bathroom without washing your hands.  The state diagram is as follows:

 wash-your-hands.jpg

3D Mirror State Diagram

Filed under: 8: State Machine, Paul Castellana — paulcastellana @ 1:15 am

Continuing with the 3D Mirror concept, I want to luminate each moving block according to its position, so as it moves it’s constanting changing color.

3dmirrorstatediagram.pdf

Next Page »

Blog at WordPress.com.