`This project focuses on transforming our way of learning about world issues into something fun and informative. My partner had the idea from the fact that her schoolmates do not frequently discuss the current events that are happening in the world, yet they all collectively acknowledge that it is necessary for them to know the news that is happening in this fast-paced world. Personally, I found it to be very interesting too. Because seldom it is hard to keep up with the news and issues. In addition to that, sometimes the news are heavy and heartbreaking, so I prefer to not read it. With this project, my partner and I are determined to make reading the news interesting and entertaining. In order to fulfill our goal, we will try out best to make our project utilize both Arduino and processing thoroughly.
For the design of the project, there will be a medium-sized carpet or mat that has the world map on it. We were thinking of ordering the world map from Taobao, but if we could not find it we will paint it on a wood board. After that, we will attach buttons in some countries according to the Arduino ports and add LEDs, therefore, the user can step on it and the screen will display the news of that country. For the source of the news, we were thinking of using twitter, as that is the platform where people can freely express their opinions and the diversity of those opinions is what we were looking for. I would also make the project to involve the user a lot, so we were thinking of using the laptop’s webcam to display the user’s face as the person saying all the news from a speech bubble.
Attached above is the approximate timeline of our project. We will try ordering the map this weekend, and if that does not work then we will paint it. Next week, we will write the code and build the circuits for the Arduino. Our professor told us to search for examples from the internet on how to combine twitter or other news social media into processing using API, therefore we will do some research on that by next week. After we have our Arduino code done, we will write the code for processing, this code will display the tweets and the news. Also, we will have to draw the body for the user and use the webcam camera to add the user’s face to the drawing. I think that the most difficult part will be on the processing code and the integration between Arduino and processing. Therefore, I added a trial and error week on December, so that whatever’s not working after our initial work can be fixed or changed.
What we want most from the outcome of our project is to appeal to the user so that they would be interested in using the product, and to make them want to use our product over and over again. This (hopefully) will be achieved by making the world carpet as interesting as possible and by the design of the tweets and the speech bubble to make it seems funny and engaging. My partner and I believed that our project is significant as it educates and entertains at the same time. This kind of project is not common and we hope to make a really good rendition out of our own ideas. The most important thing about our project is that it aligns with our definition of interaction. The user will have to “read” the world map, “think” where to press and what the button does, and then “speak” as the outcome of seeing the news. The interaction will be a cycle as the news will be different each time the user presses the button (we will make sure of that) and it would be very exciting as the user reads the thoughts and opinions of other people regarding the issue that is happening. This project can also be simplified or advanced to fit different audiences. For example, maybe instead of reading the tweets, it would show the most popular places people can go in that area, or the language that the people speak, or even the songs that people listen to. Either way, this project fulfills its intended purpose as a fun educational tool.
Our project focuses on people who live with anxiety or are under a lot of stress, whether it’s at work or at school. But people living in places like Shanghai are more stressed. Studies have shown that people who live with anxiety or stress for a long time are more likely to suffer from heart disease, depression, and even suicide. In order to relieve the anxiety of people living in the city, we designed the interaction with the machine to visually release people’s stress. Studies have shown that people are willing to take more physical violence to relieve stress and watching videos, screaming or crying are the most effective and intuitive ways to relieve anxiety. In my previous thinking, I wanted to help people reduce stress by creating a dark night and playing soothing music. According to the survey, this kind of passive immersion decompression effect is not as good as screaming and noise, and it is more difficult to create a closed environment. So we chose a more physical way to help people reduce stress.At present, the difficulty we are facing is that there are many ways of physical decompression. We don’t know what to choose, such as screaming, crushing instant noodles, jumping all the time. How to make these behaviors happen at the same time and interact with the screen is what we are thinking about. And we don’t want to cause waste or noise pollution. How to create a small area of closed environment is also a problem we are thinking about.When these people who feel great pressure have used our project, our expected impact is that these people relieve the psychological pressure through physical interaction and can directly feel this person happier than before through others. We hope that the audience can reduce the pressure through 5 minutes of project experience, and the effect is visible.
Project Plan
The main goal of our project is to help people who are under pressure release pressure in a short period of time. In order to avoid making noise for others, we plan to let the audience wear helmets, and the sound insulation effect of helmets will be very good, and then build electronic components to place in the instant noodles, so that the audience can realize the movement of characters in the game by squeezing the instant noodles. So we plan to make a game of controlling personas through sound, squeeze, and foot movement. Business is responsible for jumping, squeezing instant noodles, controlling direction through pressure, and finally moving forward through steps. According to the research, when people feel stressed, looking at some complex pictures will feel that the pictures are moving, so at the beginning, we test people’s stress by some pictures. People who are really anxious don’t focus on one thing, so at the beginning of the game we will ask the audience to focus on a certain picture all the time. There are no other special requirements for the audience, just be able to focus on one thing at the beginning. As for the progress of the project, we plan to make the first cover of processing, the design of complex patterns, and test the actual effect of putting electronic components into instant noodles from next week, and use laser cut to make helmets. In the second week, we will make pressure floor design and game interface design, and finally form a system of them. Decoration and beautification. And made some changes after the user text,
Context And Significance
As mentioned before, the survey on the Internet lets us switch from providing immersive passive decompression method to actively releasing pressure through various senses of the body. For example, an interesting project lets people shatter the glass in the screen by screaming. When the decibel is higher than a certain value, the audience succeeds. So I decided to use the sound as the medium in my project. My definition of interaction is to make the project interesting and practical in a physical way to meet the needs of a specific population. Through human-computer interaction or human interaction. Our project is original.I think the biggest significance of our project is to focus on the people who live under pressure and help them release energy in a short period of time, so as to avoid the physical or mental diseases caused by the lack of pressure release. Most importantly, the anxiety of modern people is rising. If there is no way to effectively alleviate it, it will become a serious social problem. If our project is successful, it is a happy experience for anxious people, and we hope to continue to develop into a complete decompression experience. In this way, it will become a real commodity, which can effectively reduce the pressure, be simple and replicable, and enable people to easily access the decompression service. I’ve noticed that there’s no such thing as high stress in health insurance, so our project essentially provides health care outside the hospital. Let people get rid of sub-health is our value
In this week’s recitation, we were given 2 exercises to complete. The purpose of these exercises is to make us familiar with sending values from Arduino to processing and the other way around. Most of the code has been provided from the examples, but we have to change the number of values and the function of the values.
Exercise 1: Etch-A-Sketch
This exercise focuses on sending values from Arduino to processing. We have to attach two potentiometers to the breadboard and let the values from the potentiometers control the direction of the line. For the first part, we were told to make an ellipse that is moving according to the values from the potentiometer. Below is the video:
The second part is where we have to change the ellipse to a line. We also have to use the previous value of the x and y position so that the line is continuous and smooth. Since the value read by the Arduino ranged from 0-1023, we have to map it to 0-255. This is the video of the final result:
Exercise 2: Musical Instrument
For the second one, the circuit is very simple as we only have to attach one buzzer to the breadboard. We use the tone function and use the value read from processing as the tone. In the processing, it reads the x and y position of the cursor and sends those values to Arduino. Below is the video:
Code:
Etch-a sketch
// IMA NYU Shanghai
// Interaction Lab
// For receiving multiple values from Arduino to Processing
/*
* Based on the readStringUntil() example by Tom Igoe
* https://processing.org/reference/libraries/serial/Serial_readStringUntil_.html
*/
import processing.serial.*;
String myString = null;
Serial myPort;
int NUM_OF_VALUES = 2; /** YOU MUST CHANGE THIS ACCORDING TO YOUR PROJECT **/
int[] sensorValues; /** this array stores values from Arduino **/
float psensorValue0;
float psensorValue1;
void setup() {
size(500, 500);
background(255);
setupSerial();
}
void draw() {
updateSerial();
printArray(sensorValues);
float x = map(sensorValues[0], 0, 1023, 0, width);
float y = map(sensorValues[1], 0, 1023, 0, height);
stroke(0);
strokeWeight(2);
line( psensorValue0, psensorValue1, x, y);
psensorValue0 = x;
psensorValue1= y;
// use the values like this!
// sensorValues[0]
// add your code
//
}
void setupSerial() {
printArray(Serial.list());
myPort = new Serial(this, Serial.list()[ 3 ], 9600);
// WARNING!
// You will definitely get an error here.
// Change the PORT_INDEX to 0 and try running it again.
// And then, check the list of the ports,
// find the port "/dev/cu.usbmodem----" or "/dev/tty.usbmodem----"
// and replace PORT_INDEX above with the index number of the port.
myPort.clear();
// Throw out the first reading,
// in case we started reading in the middle of a string from the sender.
myString = myPort.readStringUntil( 10 ); // 10 = '\n' Linefeed in ASCII
myString = null;
sensorValues = new int[2];
}
void updateSerial() {
while (myPort.available() > 0) {
myString = myPort.readStringUntil( 10 ); // 10 = '\n' Linefeed in ASCII
if (myString != null) {
String[] serialInArray = split(trim(myString), ",");
if (serialInArray.length == NUM_OF_VALUES) {
for (int i=0; i<serialInArray.length; i++) {
sensorValues[i] = int(serialInArray[i]);
}
}
}
}
}
void setup() {
Serial.begin(9600);
}
void loop() {
int sensor1 = analogRead(A0);
int sensor2 = analogRead(A1);
/// int sensor3 = analogRead(A2);
// map(sensor1, 0, 1023, 0, 255);
// keep this format
Serial.print(sensor1);
Serial.print(“,”); // put comma between sensor values
Serial.print(sensor2);
// Serial.print(“,”);
// Serial.print(sensor3);
Serial.println(); // add linefeed after sending the last sensor value
// too fast communication might cause some latency in Processing
// this delay resolves the issue.
delay(100);
}
Musical Instrument
#define NUM_OF_VALUES 2 /** YOU MUST CHANGE THIS ACCORDING TO YOUR PROJECT **/
/** DO NOT REMOVE THESE **/
int tempValue = 0;
int valueIndex = 0;
/* This is the array of values storing the data from Processing. */
int values[2];
if (values [1] == true) { //if mouse is pressed which is at position 1 (which is mouse press) then…
tone(13, values[0]); //at pin 11 play the mouse x values frequency
}
else {
noTone(13);
}
}
//recieve serial data from Processing
void getSerialData() {
if (Serial.available()) {
char c = Serial.read();
//switch – case checks the value of the variable in the switch function
//in this case, the char c, then runs one of the cases that fit the value of the variable
//for more information, visit the reference page: https://www.arduino.cc/en/Reference/SwitchCase
switch (c) {
//if the char c from Processing is a number between 0 and 9
case ‘0’…’9′:
//save the value of char c to tempValue
//but simultaneously rearrange the existing values saved in tempValue
//for the digits received through char c to remain coherent
//if this does not make sense and would like to know more, send an email to me!
tempValue = tempValue * 10 + c – ‘0’;
break;
//if the char c from Processing is a comma
//indicating that the following values of char c is for the next element in the values array
case ‘,’:
values[valueIndex] = tempValue;
//reset tempValue value
tempValue = 0;
//increment valuesIndex by 1
valueIndex++;
break;
//if the char c from Processing is character ‘n’
//which signals that it is the end of data
case ‘n’:
//save the tempValue
//this will b the last element in the values array
values[valueIndex] = tempValue;
//reset tempValue and valueIndex values
//to clear out the values array for the next round of readings from Processing
tempValue = 0;
valueIndex = 0;
break;
//if the char c from Processing is character ‘e’
//it is signalling for the Arduino to send Processing the elements saved in the values array
//this case is triggered and processed by the echoSerialData function in the Processing sketch
case ‘e’: // to echo
for (int i = 0; i < NUM_OF_VALUES; i++) {
Serial.print(values[i]);
if (i < NUM_OF_VALUES – 1) {
Serial.print(‘,’);
}
else {
Serial.println();
}
}
break;
}
}
}
import processing.serial.*;
int NUM_OF_VALUES = 2; /** YOU MUST CHANGE THIS ACCORDING TO YOUR PROJECT **/
Serial myPort;
String myString;
// This is the array of values you might want to send to Arduino.
int values[] = new int[NUM_OF_VALUES];
void setup() {
size(500, 500);
background(0);
printArray(Serial.list());
myPort = new Serial(this, Serial.list()[ 3 ], 9600);
// check the list of the ports,
// find the port "/dev/cu.usbmodem----" or "/dev/tty.usbmodem----"
// and replace PORT_INDEX above with the index of the port
myPort.clear();
// Throw out the first reading,
// in case we started reading in the middle of a string from the sender.
myString = myPort.readStringUntil( 10 ); // 10 = '\n' Linefeed in ASCII
myString = null;
}
void draw() {
background(0);
values [0]= mouseX;//frequency is changing based on moving the mouse around, sends to arduino
values [1]=int(mousePressed);// turn true or false (boolean) into an integer that can be sent
// sends the values to Arduino.
sendSerialData();
// This causess the communication to become slow and unstable.
// You might want to comment this out when everything is ready.
// The parameter 200 is the frequency of echoing.
// The higher this number, the slower the program will be
// but the higher this number, the more stable it will be.
echoSerialData(200);
}
void sendSerialData() {
String data = "";
for (int i=0; i<values.length; i++) {
data += values[i];
//if i is less than the index number of the last element in the values array
if (i < values.length-1) {
data += ","; // add splitter character "," between each values element
}
//if it is the last element in the values array
else {
data += "n"; // add the end of data character "n"
}
}
//write to Arduino
myPort.write(data);
}
void echoSerialData(int frequency) {
//write character 'e' at the given frequency
//to request Arduino to send back the values array
if (frameCount % frequency == 0) myPort.write('e');
String incomingBytes = "";
while (myPort.available() > 0) {
//add on all the characters received from the Arduino to the incomingBytes string
incomingBytes += char(myPort.read());
}
//print what Arduino sent back to Processing
print( incomingBytes );
}
The goal of this recitation was to first create an etch-a-sketch game through the use of processing and Arduino combined. In part 2, I also used processing and Arduino in tandem to create musical sounds based on the positioning of the mouse. In order to begin the process for part 1, I used the provided folder that sends multiple values from Arduino to processing for both my Arduino and Processing sketches. In this particular project, I hope to gain a broader understanding of how I can manipulate different variables within the project. By this I mean that I don’t just want to do the minimum, but I want to go beyond that and push the boundaries if I have time to do so. All code that I mention throughout this documentation can be viewed in the “My code” section at the bottom of this document.
Part 1
In order to begin this part, I first needed to physically set up my breadboard and Arduino by plugging in two different potentiometers to the board. These two potentiometers were to serve as my controls for the etch-a-sketch once the final process was in motion. For now, I assigned these two potentiometers in Arduino coding as serial.print (sensor 1) and serial.print(sensor 2) with comma lines in between. During this, I also assigned each sensor value to the correlated analog value (in this case A0 and A5) under void loop. Through these steps, my Arduino code was set and ready to use processing as a canvas. For the processing portion of this step, I also used Arduino to processing under the multiple values folder to facilitate the process of connecting the code with the physical board. To create this, I first inserted my port # [6] and also created 2 number values defined at the beginning of my code. These two values correlated with the 2 sensor values I had created in Arduino to link with the two potentiometers I had. After doing so, I created an ellipse ( ellipse(sensorValues[0], sensorValues[1], 150, 150); ) so become the base of the etch-a-sketch. After, I ran the processing sketch and used the potentiometers to control the x and y orientations on my screen which created a messy picture. A video of the process can be viewed below.
Part 2
The objective of part two was to create a musical instrument using techniques from Arduino and processing combined together. For the physical portion, I just need a buzzer to convey the sound of my instrument. In the draw portion of processing I inserted high and low notes to correlate with different sections of the canvas. To split the canvas in half and have each note correlate with one side of it. To do this, I created (mouseX > width/2) which said whenever I move the mouse to a select side, the note (high or low) would play on that side. To send a value to the Arduino, I also created the same code (mouseX > width/2) along with the high and low notes. Somehow the video I recorded that day has become lost within my computer so while I cannot give a comprehensive video of the project, I can provide this picture of the setup. Essentially, when I would move my mouse to one side of the screen it would make a high pitched note. And when I would move my mouse to the opposite side of the screen, a low pitched sound would play on the speaker as a result.
Reflection
In both projects, my code and process went as planned. So far as smoothness goes, this was my most successful recitation. Unfortunately, I did not get to further work with my projects and manipulate their variables as planned. In my off time, I plan to further pursue the musical project to an extent and possibly include it in my final project. I think for my project, it could be a useful tool when hovering or clicking on things on the screen. Seeing as the basis of my project so far is allocated on processing and involved with sound, this is an extremely useful skill to have for the future.
My code
Part 1 Etch-a-sketch
Arduino code:
// IMA NYU Shanghai// Interaction Lab// For sending multiple values from Arduino to Processingvoidsetup(){Serial.begin(9600);}voidloop(){intsensor1=analogRead(A0);intsensor2=analogRead(A5);// keep this formatSerial.print(sensor1);Serial.print(",");// put comma between sensor valuesSerial.print(sensor2);Serial.println();// add linefeed after sending the last sensor value// too fast communication might cause some latency in Processing// this delay resolves the issue.delay(100);}
Processing code:
// IMA NYU Shanghai// Interaction Lab// For receiving multiple values from Arduino to Processing/* * Based on the readStringUntil() example by Tom Igoe * https://processing.org/reference/libraries/serial/Serial_readStringUntil_.html */import processing.serial.*;
String myString = null;
Serial myPort;
int NUM_OF_VALUES = 2; /** YOU MUST CHANGE THIS ACCORDING TO YOUR PROJECT **/int[] sensorValues; /** this array stores values from Arduino **/voidsetup() {
size(500, 500);
background(0);
setupSerial();
}
voiddraw() {
updateSerial();
printArray(sensorValues);
ellipse(sensorValues[0], sensorValues[1], 150, 150);
// use the values like this!// sensorValues[0] // add your code//
}
void setupSerial() {
printArray(Serial.list());
myPort = new Serial(this, Serial.list()[6], 9600);
// WARNING!// You will definitely get an error here.// Change the PORT_INDEX to 0 and try running it again.// And then, check the list of the ports,// find the port "/dev/cu.usbmodem----" or "/dev/tty.usbmodem----" // and replace PORT_INDEX above with the index number of the port.
myPort.clear();
// Throw out the first reading,// in case we started reading in the middle of a string from the sender.
myString = myPort.readStringUntil( 10 ); // 10 = '\n' Linefeed in ASCII
myString = null;
sensorValues = newint[NUM_OF_VALUES];
}
void updateSerial() {
while (myPort.available() > 0) {
myString = myPort.readStringUntil( 10 ); // 10 = '\n' Linefeed in ASCIIif (myString != null) {
String[] serialInArray = split(trim(myString), ",");
if (serialInArray.length == NUM_OF_VALUES) {
for (int i=0; i<serialInArray.length; i++) {
sensorValues[i] = int(serialInArray[i]);
}
}
}
}
}
Part 2 Musical Instrument:
Arduino code:
// IMA NYU Shanghai// Interaction Lab// This code sends one value from Processing to Arduino importprocessing.serial.*;SerialmyPort;intvalueFromArduino;voidsetup(){size(500,500);background(0);printArray(Serial.list());// this prints out the list of all available serial ports on your computer.myPort=newSerial(this,Serial.list()[6],9600);// WARNING!// You will definitely get an error here.// Change the PORT_INDEX to 0 and try running it again.// And then, check the list of the ports,// find the port "/dev/cu.usbmodem----" or "/dev/tty.usbmodem----" // and replace PORT_INDEX above with the index number of the port.}voiddraw(){// to send a value to the Arduinoif(mouseX>width/2){myPort.write('H');}else{myPort.write('L');}}
Processing code:
// IMA NYU Shanghai// Interaction Lab// This code sends one value from Processing to Arduino import processing.serial.*;
Serial myPort;
int valueFromArduino;
voidsetup() {
size(500, 500);
background(0);
printArray(Serial.list());
// this prints out the list of all available serial ports on your computer.
myPort = new Serial(this, Serial.list()[6], 9600);
// WARNING!// You will definitely get an error here.// Change the PORT_INDEX to 0 and try running it again.// And then, check the list of the ports,// find the port "/dev/cu.usbmodem----" or "/dev/tty.usbmodem----" // and replace PORT_INDEX above with the index number of the port.
}
voiddraw() {
// to send a value to the Arduinoif (mouseX > width/2) {
myPort.write('H');
} else {
myPort.write('L');
}
}
The project aims to stress the importance of collaboration between countries which can bring benefits to all human beings. My partner and I are inspired by the brutal consequence caused by wars and fights between countries for resources and money and we want to make a game to aware people that the only way we humans can develop is to cooperate in peace. Violence will lead to nowhere but destroy.
This is a game which involves two people. We are going to create a landscape(made by cupboard)which is divided into three areas with a road that goes through it. The three areas will each represent primitive society, feudal society, and modern society. Along the road, there will be dozens of LED lights to show the players’ position(my partner is considering to use cars with trail tracking sensors on it to go along the road as a substitute for LEDs because of the difficulty it causes to hook up all LEDs in one board, but it is still under discussion). Both of the players will start from primitive society and they are acting the leader of their own society. In the beginning, each of them will have the same blood stripe and the same amount of resources(shown in Processing). If they want to develop their society, they need more resources and there are two ways to gain resources. Two players take turns to throw dice on Processing to decide how many steps they are going to take. The LED lights will blink to show their position. After they take steps, they will obtain weapons and random amounts of resources to feed their society. After the player gets the weapon, he can choose to use it or not. There will be a blood bar in the processing screen and a button to control the fill of the bar to let the player decide how much blood he want the other player to drop. Also, with the power of the weapon increase, the range of the bar will increase to represent more damage than a weapon can cause. If the player chooses to use the weapon the blood stripe of the other player will decline and he will gain half of the other player’s resources(the resources bar is still under discussion). If he chooses not to use the weapon. both players can obtain a certain amount of resources. As the game going on, when each player enters a new society, the background of their character shown in Processing will change relatively(still under discussion). The weapon players get will be more and more powerful which represents how does the development of the technology increase the collapsing force of the weapon such as the atomic bomb. And when one of the players gets the atomic and chooses to use it, both of the two societies will be destroyed and nobody wins. Also, there will be videos show the scene of the boom blow up to warn people of the dangers of the weapon. But if the player chooses not to use it, bot of them will win the game and get rewards(candies).
PROJECT PLAN
We plan to first finish the programming in processing before December 1st (figuring the dice and find video and pictures and let them talk to processing)and finish the build of the whole landscape and the connection of the Arduino and let them talk to each other before December 5th.
CONTEXT AND SIGNIFICANCE
According to my previous research, I have analyzed these project:
Ethical Things – The mundane, the insignificant and the ‘smart’ (things)
These complete my definition of interaction: a cyclic process that requires at least two objects (both animate and inanimate are accepted) individually has its input-analyze-output. Also, the whole process needs to be meaningful and forms a loop that allows the user to continually interact with it. Our final project–the epic of us, target everyone in the earth to let them be aware of the severe consequence caused by the fights between countries for resources and profits. It is fun since it is a game, it can give a response to the player’s action and allow the player to take another action. Also, interaction appears between two players since they have to interact with each other to win,