2012年5月13日 星期日
Review by Terry
1. What is your favorite homework?
I was interested in the electronic drawing board which was homework4. At the beginning I could't imagine
how to make it and then finally I made own my board that looks like real painting board on window 7.
In addition to that, fortunately It helped to understand how it works.
2. What did you learn in this course?
I can make any application by processing and arduino because I have learned about how to use program which I used to and how to control. However, I thought need to make sense to do each homeworks and add more functions with application.
Even though I am not a hardware engineer, I can control Arduino board easily with software which I have learned in the class. Moreover, when I had any problem, I tried to find a way to slove it with example on website. I think
their supporting is very nice for beginner.
3. What did you change after this course?
Actually to control the hardware is difficult for software engineer like us. because last semester, I took the
Micro-controller class with classmates. All of them said it is not easy and difficult to understand. But this, arduino,
is really awesome and any software engineer can control anything what he want to do. Later I hopefully want to buy new arduino board and I will make some application or kit useful at my house.
Final Show - Terry & Alvin
Click below address for watching.
http://www.youtube.com/watch?v=CFYT9LhV4Yo
2012年4月18日 星期三
HW10_4: Arduino Piano Show
2012年4月15日 星期日
HW10_04: Arduino LED Show
HO09_03: Seven Colorful LEDs
HW09_02: LED Traffic Light
HW09_01 : Blinking LED
2012年4月14日 星期六
HW06-1 : Kill Mosquitos
2012年3月12日 星期一
HW05-2 :

int num = 50;
int[] x = new int[num];
int[] y = new int[num];
int r,g,b;
void setup() {
size(400, 272);
noStroke();
smooth();
fill(255, 102);
}
void draw() {
background(0);
// Shift the values to the right
for (int i = num-1; i > 0; i--) {
x[i] = x[i-1];
y[i] = y[i-1];
}
// Add the new values to the beginning of the array
x[0] = mouseX;
y[0] = mouseY;
// Draw the circles
for (int i = 0; i < num; i++) {
r = int(random(255));
g = int(random(255));
b = int(random(255));
fill(r,g,b);
ellipse(x[i], y[i], i/2.0, i/2.0);
}
}
****************************************************************************HW05

HW04-1
void setup() {
size(500, 400);
strokeWeight(3);
smooth();
background(255);
// colors
fill(255, 0, 0);
rect(0, 0, 50, 50);
fill(0, 255, 0);
rect(0, 50, 50, 50);
fill(0, 0, 255);
rect(0, 100, 50, 50);
fill(0, 0, 0);
rect(0, 150, 50, 50);
// strokes
fill(255);
rect(450, 0, 50, 50);
fill(0);
ellipse(475, 25, 2, 2);
fill(255);
rect(450, 50, 50, 50);
fill(0);
ellipse(475, 75, 6, 6);
fill(255);
rect(450, 100, 50, 50);
fill(0);
ellipse(475, 125, 10, 10);
// functions
fill(255);
rect(450, 150, 50, 50);
fill(0);
text("ERASE", 455, 180);
fill(255);
rect(450, 200, 50, 50);
fill(0);
text("CLEAR", 455, 230);
fill(255);
rect(450, 250, 50, 50);
fill(0);
text("SAVE", 460, 280);
}
void draw()
{
if (mousePressed && mouseX >=0 && mouseX <= 50 && mouseY >= 0 && mouseY <= 50)
stroke(255, 0, 0);
if (mousePressed && mouseX >=0 && mouseX <= 50 && mouseY >= 50 && mouseY <= 100)
stroke(0, 255, 0);
if (mousePressed && mouseX >=0 && mouseX <= 50 && mouseY >= 100 && mouseY <= 150)
stroke(0, 0, 255);
if (mousePressed && mouseX >=0 && mouseX <= 50 && mouseY >= 150 && mouseY <= 200)
stroke(0, 0, 0);
if (mousePressed && mouseX >= 450 && mouseX <= 500 && mouseY >= 0 && mouseY <= 50)
strokeWeight(2);
if (mousePressed && mouseX >= 450 && mouseX <= 500 && mouseY >= 50 && mouseY <= 100)
strokeWeight(6);
if (mousePressed && mouseX >= 450 && mouseX <= 500 && mouseY >= 100 && mouseY <= 150)
strokeWeight(10);
// erase
if (mousePressed && mouseX >= 450 && mouseX <= 500 && mouseY >= 150 && mouseY <= 200)
stroke(255);
// clear
if (mousePressed && mouseX >= 450 && mouseX <= 500 && mouseY >= 200 && mouseY <= 250)
clear();
// save
if (mousePressed && mouseX >= 450 && mouseX <= 500 && mouseY >= 250 && mouseY <= 300)
save("line.tif");
if (mousePressed && mouseX >= 55 && mouseX <= 445 && mouseY >= 0 && mouseY <= 400)
{
line(mouseX, mouseY, pmouseX, pmouseY);
}
}
void clear()
{
noStroke();
fill(255, 255, 255);
rect(52, 0, 395, 400);
}
I can simply use this one to draw any picture what I want.

