Jack’s 9th Project: Interactive Circle

screen-0146 screen-0209 screen-0717 screen-3970 screen-5045 screen-5521 screen-6190

When you stares at those circles, you may feel weird, because you do not see the cursor, and you do not know what is going on. Actually, this is a interactive circle, when you move your mouse around in this circular area, the color of this area will be changing all the time. Uppermost is red, lower-left is green and lower-right is blue. Any other position would be a mixture of three different color, which makes it beautiful. Here is a short video demonstrating what it looks like.

Here are the codes:


Button btn;
int oldKey = 0;

void setup() {
btn = new Button(height/2,width/2,height/2);

void draw() {
// press ‘s’ to save image in the default folder
if (key == ‘s’ || key == ‘S’) {
if (oldKey == 0) {
oldKey = 1;
} else {
oldKey = 0;

class Button {
float btnX, btnY, btnD;
color btnColorNow, btnColorHover, btnColorActive, btnColorNorm;
boolean btnIsActive = false;
float r = 255, g = 255, b = 255;
float distance;
float redDist, greenDist, blueDist;

Button(float temD, float temX, float temY) {
btnX = temX;
btnY = temY;
btnD = temD;
btnColorNorm = color(255);
btnColorHover = color(r, g, b);
btnColorActive = color(0, 0, 255);

void update() {
if (circleOver()) {
r = 255;
g = 255;
b = 255;
distance = dist(mouseX,mouseY,btnX,btnY);
redDist = dist(mouseX,mouseY,btnX,btnY-btnD/2);
greenDist = dist(mouseX,mouseY,btnX-sqrt(3)*btnD/4,btnY+btnD/4);
blueDist = dist(mouseX,mouseY,btnX+sqrt(3)*btnD/4,btnY+btnD/4);
// r *= map(redDist,0,btnD/2,0,1);
// g *= map(greenDist,0,btnD/2,0,1);
// b *= map(blueDist,0,btnD/2,0,1);

r *= map(greenDist,0,btnD/2,0,1) * map(blueDist,0,btnD/2,0,1);
g *= map(redDist,0,btnD/2,0,1) * map(blueDist,0,btnD/2,0,1);
b *= map(redDist,0,btnD/2,0,1) * map(greenDist,0,btnD/2,0,1);

btnColorHover = color(r, g, b);
btnColorNow = btnColorHover;
else {
btnColorNow = btnColorNorm;

void mousePressed() {
if (circleOver()) {
btnColorNow = btnColorActive;

void mouseReleased() {


void draw() {
ellipse(btnX, btnY, btnD, btnD);
// line(btnX-btnD/2, btnY, btnX+btnD/2, btnY);
// line(btnX, btnY-btnD/2, btnX, btnY+btnD/2);

boolean circleOver() {
float distance = sqrt(sq(mouseX-btnX) + sq(mouseY-btnY));
if (distance<=btnD/2) {
return true;
else {
return false;


Jack’s Final Project Proposal

Interaction involves at least two sides, one acts, the other reacts, so they interact. It can also involve in multi-sides, which means all different sides may interact with one another. Speaking of interaction, what comes to my mind first is a robot. In terms of a robot, I have two plans so far, one a ball-shaped robot, the other a display-built-in robot.


Typically, an android moves not very smoothly, or at least less smoothly than a robot with wheels. But there are conditions that even a wheeled robot cannot handle. Among all those types of motions, rolling must be the most flexible one. So if anyone can build a ball-shaped robot, it will be able to adapt to almost all kinds of situations. With ultrasonic sensors, it will know the distance between an object or a wall and itself. With infrared sensors, it will be able to detect a high temperature object, or a human body. Thus, it can interact with the world around it or even accomplish some tasks.

However, there are also some challenges for building a ball-shaped robot. The first and the most important one is how to make it move. I still need to research on it, or create some new ways to do it. Also, stability is another problem. It is ball-shaped so as to be flexible but too flexible. It might be hard to make it still. Basically, the challenges are about how to control it, in other words, move and pause whenever needed.


The previous may interact more with the physical environment and less with human beings. This one does more with humans. The display would basically show the face of the robot. To make the robot emotional, it may cry when hurt, laugh when playing. This one would be much more complicated in terms of programming. Also, this one requires more parts. It just involves in much more inputs and outputs.

There are tons of situations that you may want to consider. The robot may get tired after playing or working for a long time. The robot may go and charge himself when power is needed. The robot may have stories to tell and learn from the humans, which are unlikely to be included in my final project.

The biggest challenge for this thing is to control the display, which I have not experienced yet. And the codes may be even more challenging but I believe I will enjoy it. Also, I do not know if there are enough space for me to plug in all different wires. Maybe I also need to make my own circuit board.

There is actually another option: to connect iPhone with the robot, letting iPhone be the face of the robot. This way, the face will be more vivid as a result of iPhone’s retina display. It may even make the use of iPhone’s speaker and microphone, so that the arduino itself requires less parts. However, I haven’t learned how to connect an Arduino with an iPhone so far. I do still have a lot to learn.

Jack’s 8th Project: Controlling a Motor

NOTE: This project is a cooperation of BOTH Jack Du and Collin Du.

What we built is a motor controlled by a transistor and current regulator. The transistor helps to provide higher voltages for the motor, and the current regulator controls the voltages the motor has so as to control the revolution. At last, we soldered some wires so that they will be connected permanently.

IMG_0320 IMG_0321 IMG_0325 IMG_0324 IMG_0323

This is a link to the Video.

Lab 8 Dongning and Stella

This week’s lab is about using a transistor to control high current loads with an Arduino. We used the following parts to make the circuit:  potentiometer, diode, DC power supply and transistor. The first time, we did not know that the diode had electrode, so we just randomly set the diode. The second time, after making a correction of the diode, the circuit did work, for seconds. Then we found out that we just burned out the Arduino since we connected the 5V power supply and the external power supply together. Because of the shortage of Arduino and limited time, we could not make the circuit again. Yet we still had made the motor controlled by the potentiometer, for seconds, and with the wrong connection.

433833542 1547888534

Rough Cut: Connie, Villa and Alicja

Here is the rough cut of our project – homage to Shanghai:

Brief reflection:

Editing is hard! Trying to decide what to cut and what to use, finding appropriate music, figuring out transitions… We certainly did learn a lot in the process.

We realize the video is perhaps too long, and the transitions are not as smooth as they could be, but we are hoping for class suggestions on what to cut, what and how to edit, which parts are interesting and which ones are boring, as we found that we feel very strongly about our footage, which makes it hard to make decisions. That’s why we are excited to present it in class and hear some advice given from a different perspective.

ZZ, Guillermo, Mental, and Max Sound Project Revisions

Our sound project was a lot of fun when we recorded it and brought it together.  It was really cool to start at the beginning with learning how to use the different equipment, software , cables, and microphones.  But with any project there are many aspects that must be improved.

In class, some of the suggestions that we got were about volume, specifically about regional volume: ensuring that some parts weren’t significantly louder than others.  For example, the voice of the narrator in some segments was too low compared with the voice of the sorting hat or whoever else was talking.  In some cases this was because we had had two people recording at one time and one person was further away physically from the microphone.  So in our revision process we adjusted the volume in the very specific regions that sounded lower than the portions around them.  Basically we made the narrator’s voice sound louder.  Particularly for the narrator, we knew that that was important because a narrator should sound like a voice that is over everything, rather than a voice coming from far off in one direction.

Another thing that we tried to fix in our project was to adjust the ‘p’ sound that came in some of the sections where for example, the ‘p’ sound in ‘Potter’ or ‘People’ or ‘Professor McGonnagall’ would be too loud, and cut out at the top.

We think it sounds better now, and we are feeling pretty good about the sound project.


Max, ZZ, Guillermo, and Mental