Week 1
Minor Makerslab
Week 3
Week 4
Week 5
Week 2
Duy-Linh Pham
Week 6
Week 7
Unlearning Manifesto
Zines
Week 8-10
Arduino Code
void setup() {
Serial.begin(9600);
delay(500);
pinMode(D1, OUTPUT); // Trigger distance sensor
pinMode(D2, INPUT); // Echo distance sensor
}
// Variable for the time between the sensor and the object
long duration = 0;
// Variable for the distance between the sensor and the object
int distance = 0;
// Variable to remember the last measured distance
int lastDistance = 0;
void loop() {
// Code from: http://www.instructables.com/id/Simple-Arduino-and-HC-SR04-Example/
// Trigger will be turned off before starting measuring
digitalWrite(D1, LOW);
delayMicroseconds(2);
// Trigger will be turned on for 10 micro seconds
digitalWrite(D1, HIGH);
delayMicroseconds(10);
// Trigger will be turned off
digitalWrite(D1, LOW);
// Reads the distance in time
duration = pulseIn(D2, HIGH);
// Calculate the time to distance in cm
distance = (duration/2) / 29.1;
Serial.print("Distance is: ");
Serial.print(lastDistance);
Serial.println(" cm");
// Update the last measured distance to the variable 'distance'
lastDistance = distance;
Serial.write(lastDistance);
delay(1500);
}
Kick-off
Plotting & Mapping
Reading week
Critical Making
Collecting & Storytelling
Electronics & Open Design
Cultural interfaces
Self-directed projects
With the skills attained in week 6, use an analog or digital sensor to capture any subjective data (e.g. responses to a question, the distance of peoples preferred personal space, stress levels, ...) and visualize this data in a meaningful way using Processing.
Assignment for week 7
After learning the basics of Processing from Moritz during his workshop, I started to find some inspiration on YouTube by watching different videos on Processing. I then landed on this video about creating computer art, using mathematic equations to make an animation. The video explained exactly what had to be done, so I only had to connect the data and modify just a bit of the code.
Process
Video about computer art and how to make it
Processing Code
import processing.serial.*;
Serial myPort;
int lines = 10;
int distance;
int[] nums = {};
float t;
void setup(){
background(color(29,29,27));
size(500,500);
String portName = "/dev/tty.SLAB_USBtoUART";
myPort = new Serial(this, portName, 9600);
}
void draw() {
background(color(29,29,27));
text("How focused are you?", 25, 25);
text("Distance from screen:", 170, 25);
text(distance, 300,25);
text("cm", 320,25);
translate(width/2, height/2);
for (int i = 0; i < lines; i++){
line (x1(t + i), y1(t + i), x2(t + i), y2(t + i));
}
if (distance > 25) {
t+=0.7;
stroke(color(255,255,255));
strokeWeight(3);
}
if (distance < 25) {
t+=0.2;
stroke(color(253,230,255));
strokeWeight(1);
}
println(t);
println(distance);
}
float x1(float t){
return sin(t / 10) * 100 + sin(t / 5) * 20;
}
float y1(float t){
return cos(t / 10) * 100;
}
float x2(float t){
return sin(t / 10) * 200+ sin(t) * 2;
}
float y2(float t){
return cos(t / 20) * 200 + cos(t / 12) * 20;
}
void serialEvent(Serial myPort) {
distance = myPort.read();
}
// https://www.youtube.com/watch?v=LaarVR1AOvs
Final result
Collaborative Learning
This week I only watched YouTube videos, this got me through the whole week.
Maker Skills & Attitude
- Processing
- Connect data (from Arduino) to Processing
Learning objectives
Addition
To make the code so that it responds to the measured distance of the sensor, I went to see how the measured distance can be combined with a certain value. I simply edited a small piece of code.
The maximum value of an RGB color is 255. The given maximum value for the distance is 25. I then divided these two numbers (255/25=10,2).
For "t" I gave a maximum value of 0.7 and the given maximum value for the distance is again 25. I then divided these two numbers (0,7/25=0,028).
Besides the addition of the code I made the interface a bit clearer.
The visualization will now change color and speed according to the measured distance.
Part 2
When I started the assignment I had no idea which subjective data I would be measuring, I only knew that I would use the distance sensor. It took a long time to get to a subject, I saw myself reading the assignment dozens of times, and every time a bit closer to the screen. Eureka moment! The subjective data will be: how focused are you? The closer you get to the screen, the more focused you are. At the first development, I had done it in such a way that the closer you got to the screen, the faster the visualization moved, not everyone felt that way, they saw being focused like a kind of calmness. Being focused is like a high to me. You can't always be focused, in my case I had to force it to get to this subject. After being focused you have to rest, so all calms down in my case. It's funny how people think and feel differently about certain things.
I have tested the installation with a number of people, and when the distance sensor is on top of the laptop, people soon understand what the installation is about.