PComp_3_SuperMarioTime

During the PComp Lab_03, although as struggling as usual, I found it very enjoyable to make the speaker speak! Such a lovely moment, probably as exciting as finding the existence of fire. And I even made a short Super Mario music, sweet!

PComp_Lab_MarioTime! from JHCLaura on Vimeo.

But I found it really difficult, when me and Billy tried to adjust the volume of speaker and also to make chords(two tunes speak at the same time).

For the volume

#include "pitches.h"

int lastButtonState = LOW;
boolean switchIsOn = false;

const int threshold = 10;
const int speakerPinNum = 8;
const int noteDuration = 20;

const int potenPinNum = 5;
int volumeAnalogValue = 0;
int volume = 0;

int note[] = {NOTE_C4, NOTE_E4, NOTE_G4};

void setup() {
  Serial.begin(9600);
}

void loop() {

  int buttonState = digitalRead(2);
  volumeAnalogValue = analogRead(potenPinNum);

  volume = map(volumeAnalogValue, 0, 1023, 0, 490);
  Serial.println(volume);

  if (buttonState != lastButtonState) {
    if (buttonState == HIGH) {
      switchIsOn = !switchIsOn;
    }
  }

  lastButtonState = buttonState;

  if (switchIsOn == true) {

    analogWrite(speakerPinNum, volume);
    Serial.println(volume);

    for (int i=0; i<2; i++) {
      int noteRead = analogRead(i);

      if(noteRead > threshold) {
        tone(speakerPinNum, note[i], noteDuration);
      }
    }
  }
}

My original idea was

  1. connecting speaker to digital pin #8, and potentiometer to analog pin #A5
  2. mapping the analogInput from  0~1023 to 0~490, setting it as volume
  3. analogWrite it into pin #8

But it failed  :/

Luckily, I bumped into my 2nd year buddy Andy and bothered him a couple of minutes and his advice simply blown my mind. He suggested using the potentiometer directly between digital pin #8 and the speaker, and adjust it directly without writing any codes! Wow. How I’ve never thought about this? And it worked! It simply proved that I’ve not thought it through totally. Hmmmm so much work to do, fighting 🙂

VolumeAdjust

New codes!

#include "pitches.h"

int lastButtonState = LOW;
boolean switchIsOn = false;

const int threshold = 10;
const int speakerPinNum = 8;
const int noteDuration = 20;

const int potenPinNum = 5;
int volumeAnalogValue = 0;
int volume = 0;

int note[] = {
  NOTE_C4, NOTE_E4, NOTE_G4};

void setup() {
  Serial.begin(9600);

}

void loop() {

  int buttonState = digitalRead(2);
  volumeAnalogValue = analogRead(potenPinNum);

  volume = map(volumeAnalogValue, 0, 1023, 0, 490);
  Serial.println(volume);

  if (buttonState != lastButtonState) {
    if (buttonState == HIGH) {
      switchIsOn = !switchIsOn;
    }
  }

  lastButtonState = buttonState;

  if (switchIsOn == true) {

    for (int i=0; i<2; i++) {
      int noteRead = analogRead(i);
      Serial.println(noteRead);
      if(noteRead > threshold) {
        tone(speakerPinNum, note[i], noteDuration);
      }
    }
  }
}

PComp_03_Observation_DearElevator

Hi Elevator,

How you’re used_my assumption

  1. User walks to the elevator and stands in front of the door or waits in line.
  2. Pushes up/down button if it’s not been pushed.
  3. Walks inside when the door opens.
  4. Gentleman holds door-open button for incomers.
  5. Everyone checks if his/her destined-floor-button has been pushed or not, or he/she pushes the button or asks others to do so.
  6. The door closes.
  7. Unless it’s user’s destined-floor, user stays inside instead of stepping out.
  8. Gentleman holds door-open button for incomers and out-goers.
  9. Users says “Excuse me. Thank you.” and steps out when the elevator reaches his/her destined-floor.
  10. The End.

How you’re actually used_from observation

  • actual situation(observed in the lobby of Tisch)
    • because of the existence of smartphone, users have more patience to wait nowadays.
    • when waiting in line, users start making small chat, meeting people from different departments, and it’s a good moment to be social.
    • at 4th floor, ITP’s elevators have no signs showing where the elevators are at. Maybe because of this, users become less patient waiting and more attempting to use the stairs down.
  • different approaches
    • some stand motionlessly and wait the door to close; some keep pushing the door-close button
    • when lines get too long, some users at the back give up and choose the stair instead, and some just keep waiting.
  • difficulties
    • users have to tiptoe to see if their destined-floor button has been pushed or not.
    • users have to squeeze in to push the button if it’s crowded.
    • users have to be aware of the unpredictable closing door.
  • easy
    • just stands and goes up and down several meters effortlessly.
    • asks for help to push the buttons.
  • longest time
    • waits in line
  • shortest time
    • gives up and uses stairs instead(if users’ departments don’t reside higher than 5th floor)
  • time of whole transaction (this part is still under construction)
    • waiting:
    • duration of each floor:
    • pushing button:
    • stepping in/out:

What if… Then… Moment for you my dear Elevator

  • The display board inside the elevator shows which floor has already been chosen.
  • After being pushed, the door open/close button flashes on and off continuously to indicate that it does keep working/sending message(giving local feedback), so users won’t act crazy pushing it.
  • Set floor buttons
    1. outside the elevator, and users press the button before walking in.
    2. on the side of the door, and users press the button when walking by.
    3. hanging from the ceiling, and users pull the button(acting like pulling string).

PComp_03_MouseControl

Just have to say… Intro to Physical Computation is the most confusing and yet the most rewarding class I have in ITP so far. Problems and questions appear like bubbles from the boiling water, and when Tom Igoe explained the INPUT and INPUT_PULLUP to me in class, I felt my brain was stirred like a sticky mud. But once problems were sold, I felt I was in heaven.

Lab_02 before week_03_class

First_Arduino!!

It’s a bitter(FXCK!)-yet-sweet(YAH!) feeling when you found out that the whole problem was actually arose from a super simple reason! Frustrating about my first attempt to program Arduino and then finding LEDs failing to light up because of wrong direction. Anyway, YAH for the light!!!

During the self-labs, in the beginning I was really confused about the different wiring ways showed in the instructions, and I pondered deeply about it.

 

 

 

 

 

 

 

 

 

As pics show above, resistors were put in the different places. And then I just thought that, hey! why don’t I just try to wire it in different ways and see if it gives same result? And I tried and it did. Silly and happy.

Arduino_Lab_Test

Week_03_MouseControl

Billy and I used Joystick to control x and y. And quoting from Tom:

“… The joystick select button is a digital input, but it’s wired differently than the buttons you saw in the Digital Lab or the Mouse Control With Pushbuttons Lab. It’s wired to connect to ground when you press it. To read it, then, you’d still use digitalWrite(), but you’d expect it to go low when pressed instead of high. And instead of a pulldown resistor like you’ve used in those other two labs, you’d use a pullup resistor, so that it’s connected to 5V when the switch is not open…. … The Arduino has built-in pullup resistors that you can use on the digital inputs. When you set the pin to be an input using the pinMode() command, use the parameter INPUT_PULLUP instead of INPUT.”

So at first we wrote the press of Joystick as pinMode(3, INPUT_PULLUP), but then we found that it’s actually difficult to control x, y and press in one single stick, so we decided to add another button as the right-click-mouse. We changed back the code about digitalInput as pinMode(3, INPUT) and adjusted the related code below as well. Also, we used map() to control the speed of the mouse movement since delay() will change the entire loop speed and it’s not necessary.

inClass_MouseControl

One thing I also want to mention is that, in class classmates came out a lot of ideas about how to control the mouse. With string sensors, force sensors, tilt sensors, buttons connected with different resistors, etc. Very creative!!! I was kind of shocked yet inspired at the same time. Maybe I should stop playing safe. Just let go my imagination first, and then try to catch its tail and fly with it carelessly after???

Very interesting 🙂

PComp_02_Zoetrope

PComp_week_02_Zoetrope from JHCLaura on Vimeo.

In the 2nd class of PComp, Aaron and I made a zoetrope which is energized by a motor. So exciting!! If I were not in the class I would give it a happy shriek! This work was majorly done by talented Aaron since I haven’t got my Arduino Starter kit yet, and I borrowed one at 1 AM which is just 8 hours before the class… tragedy. Anyway, thank you Aaron!

At first, our zoetrope worked with only a potentiometer, and since we haven’t learned how to use it to get a variable supply yet but simply a on-and-off switch, we couldn’t control the speed of the motor, so it turned too fast for a clear animation. To solve this problem, Tom Igoe suggested adding a momentary switch to supply power by clicking it manually.

At first, we couldn’t make it right because we misunderstood the flow of the current. Thanks to Jason we got it done eventually. And here are some detailed pics of our work!

PComp_01_What’s_Interaction?

In the first week of PComp reading, 1) Crawford’s “The Art of Interactive Design” ch01, ch02, 2) Bret Victor’s “A Brief Rant on the Future of Interaction Design”, I’m gonna post about the question assigned from Tom, some random thoughts through the reading,  and some inspiring words. Let’s begin!

Answers to the questions(duh)

After this class’ discussion and exercise, and reading Chris Crawford’s definition and Bret Victor’s rant, how would you define physical interaction? What makes for good physical interaction? Are there works from others that you would say are good examples of digital technology that are not interactive?

  • Unlike general interactions(such as conversations etc.), the physical interaction involves materials, such as devices, chemicals, and living things. It’s a back and forth dialogue, and in the end it leaves impacts on the participants.
  • Good physical interaction won’t make its participants wander off. Participants interact with their most intuitive parts, and the experience won’t be diluted through the whole process by meaningless designs of the physical interaction.
  • The non-interactive digital technologies I can think of so far are 3D movies, tv, videogames, …, since the result of them are all set up and cannot be changed despite the different input contributed by different users.

 

Random thoughts–

  • In the first class of PComp, I found that professor Tom emphasizes “feedback” a lot, much more than others, during the class and within the words of the syllabus. And when I read through the first few sentences of “The Art of Interactive Design”, I suddenly realized that’s because feedback makes good interaction, and that’s the key to PComp. In PComp, we learn how to transform one element into another element with electronics as media, and at the same time, we are media too! We transform others’ thoughts into our thoughts, and we let other know ours. Along the loop of communication, amazing ideas bump out, just like what good interactive technology does.
  • Satisfying, joy, determine the level of interaction. → Good interactive device make users hard to stop using it.
  • I found myself match perfectly and miserably with the awful/disappointing listener/thinker/speaker described in “The Art of Interactive Design”! OMG I feel so sorry… That’s not my intention! Dear friends please keep talking to me, and I’ll learn the experience and improve just like what those hi-tech hard/softwares do.
  • Seeing “…Dancing alone to the music is not interaction; it is participation.” makes me wonder how cool will it be if dancers can interact with music, which means music will be affected by dancers’ moves as well! But questions are: besides the basic movement recognition, how to detect dancers’ emotions and how music responds? It’d be really interesting!
  • If movies can be interactive, it might turn out to be boring? Because audiences love unexpected stories. And not everyone can be a witty screenwriter.
  • My example of interactivity: Living. Characters: Human, Environment. Process: Human’s behavior build environment; environment affects human. It’s a loop.
  • Regarding the video “Vision Of The Future”, if people in the future rely heavily on the control panel which handles everything nicely for you, wouldn’t it deteriorate human’s intelligence/capability as well? But I still love one of its device, the transparent refrigerator. It’s fancy yet at the same time meaningful/eco-friendly, and it’s a small design to easily avoid cold air leaking.

 

Inspiring lines–

*Interaction: a cyclic process in which two actors alternately listen, think, and speak.
*Once words have been written down, they are scattered everywhere.
*Interactivity designer regards the thinking content of software as its function, and the user interface regards as its form.
*Interactivity design people are younger, less technical, and stronger in the arts/humanities.
*I’m not saying that we should eschew graphics, sound, or video; I’m saying that we shouldn’t make these factors the selling points of our work.
*A tool converts what we can do into what we want to do
*Pictures Under Glass sacrifice all the tactile richness of working with our hands, offering instead a hokey visual facade.
*With an entire body at your command, do you seriously think the Future Of Interaction should be a single finger?

PComp_01_FantasyDevice

Food_Replicator_As_Whole

Food_Replicator_As_Whole

Magic Ball w/ "Go" button.

Magic Ball w/ “Go” button.

In the first class of Introducing Physical Computation of Tom Igoe, for our first assignment– “fantasy devices”, Aaron and I came out of the idea of a food replicator!

HOW

  • At first, let’s skip the process of food come out from nowhere!
  • It’s a fabricate kit. With 12 expandable sticks as frames, and 8 magic balls as joints, users can put the food replicator easily into a sack, and assemble it freely into the size they want.
  • After setting up, users can use smartphone to order food products from the on-line catalog. Choose items, put in the cart, and pay the bill.
  • Once finishing the on-line order, users push the “GO” button to execute the processing. Food will suspend until users touch/grab it.
  • Beside “output” food, users can “input” too! By putting food(granny’s jam etc.) inside of the food replicator, items can be easily uploaded and preserved to the on-line catalog(but watch up the expiration date!).

DETAILS

  • 8 balls are responsible for all of the technology.
  • The control interface is simple with a “Go” button on the surface of the ball. Users push the button both to get and upload food.
  • Although only one item can be uploaded a time, multiple items can be replicated since, quote Aaron “…, the replicator will optimize the cube space to materialize as many of the items from the “cart” as is possible.”

DIFFICULTIES

  • How to define “food”? Since we don’t want to make this involve with controversial stuff like money, drugs, etc., we limit the output to be just food. Although we can find the definition of food on wiki–

Food is any substance consumed to provide nutritional support for the body. It is usually of plant or animal origin, and contains essential nutrients, such as carbohydrates, fats, proteins, vitamins, or minerals. The substance is ingested by anorganism and assimilated by the organism’s cells in an effort to produce energy, maintain life, or stimulate growth.”  

  • … still, it’s hard to execute.