Category Archives: Assignments


I tried to switch LEDs by button.

One LED is with fading, controlled by code. The other one is just physics. Some magical thing was happened that I could turn on/off the LED by air…. LOL

My code:

const int buttonPin = 7; // the number of the pushbutton pin
const int ledPin = 9; // the number of the LED pin
int brightness = 0;
int fadeAmount = 5;

// variables will change:
int buttonState; // variable for reading the pushbutton status

void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);

void loop(){
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);

// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == LOW) {
// turn LED on:
digitalWrite(ledPin, HIGH);
analogWrite(ledPin, brightness);
brightness = brightness + fadeAmount;

if(brightness == 0 || brightness == 255){
fadeAmount = -fadeAmount;
else {
// turn LED off:
digitalWrite(ledPin, LOW);



Theremidi Orchestra: Guest Lecturers Tomorrow


We are having 2 fantastic guest lecturers tomorrow of the Theremidi Orchestra from Slovenia.  We are fortunate to have two of the members  come to class to show off their instruments and critique your first projects.

200px-Robertina  Robertina Šebjanič


about  Ida Hiršenfelder

They are holding some workshops of sound making devices at Eyebeam throughout this week, and also performing on Monday evening, you should not miss it. 


Theremidi Orchestra (TO) is an audiovisual DIY community initiated by participants of the Theremini and Teremidi physical interface workshop, organised by Ljudmila – Ljubljana Digital Media Lab in May 2011. Rather than a subject, TO is a verb, an ongoing workshop of noise and drone production. This hands-on electro noise ensemble exists in the present continuous, while referring to the history of electronic music. TO has a DIY/DIWO approach in making music and sound experiments, developing its own instruments based on open-source electronic circuits. Currently TO consists of ten active members, coming from different professional backgrounds. Theremidi Orchestra is a process of mutual understanding and solving problems in a horizontal manner. The process of production involves experimenting with sound outputs, mutual composition of music scores, shared responsibilities for individual parts of the process, etc. Thus far, the orchestra performed, exhibited and held workshops at over thirty festivals and exhibitions mostly in Europe e.g. Piksel Festival in Bergen Norway; LiWoLi Festival in Linz, Austria; PoolLoop in Zürich, Switzerland; U3: Triennial of Contemporary Art, Museum of Contemporary Art in Ljubljana, Slovenia, to name just a few.

Homework: Blink, Baby, Blink!

Tried doing serial communications between Processing and Arduino. The LEDs are blinking according to the bouncing ball through mapping the bouncing ball’s y position to the number of LEDs. This number is sent through Processing to the Arduino board, where it will turn the LED in an array of LEDs with that number on.

The result is kind of buggy, maybe a change in the positioning of lights would help. But I think part of it is also the large difference in the mapping, so it would probably work much better with a lot more LEDs, which I don’t have. And also there’s probably a slight lag in the serial communication.

Screen Shot 2014-09-11 at 1.01.43 AM

Because Code Snippets is being mean to me, I’m just going to copy and paste the code here:


import processing.serial.*;

Serial myPort; // create new serial connection named myPort
int x = 0;
int y = 0;
int xspeed = 10;
int yspeed = 10;

void setup() {
String portName = Serial.list()[17];
myPort = new Serial(this, portName, 9600);

void draw() {
x = x + xspeed;
y = y + yspeed;
float m = map(y, 0, height, 0, 10);
byte val = byte(m);
// println(val);

if ((x > width) || (x < 0)) {
xspeed = xspeed * -1;

if ((y > height) || (y < 0)) {
yspeed = yspeed * -1;

// Display circle at x location



char val; // create a variable named val
int ledPins[] = { 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 }; // array of LEDs

void setup() {
for(int i=0; i<10; i++) pinMode(ledPins[i], OUTPUT); // declare all pins in array as output

void loop() {
if (Serial.available()) {
val =; // val equals the number being sent over from Processing
digitalWrite(ledPins[val], HIGH); // turn the LED with the current number from Processing on
delay(100); // delay 100
digitalWrite(ledPins[val], LOW); // turn the LED with the current number from Processing off



Hi, my name is Yu Zhang. I’m born and grow up in Shanghai, China. Just graduated for my undergraduate from University of Orgeon in product design. I love travelling and visited exhibition, gallery or museums. I’ve been to many exhibitions, and I feel the growth of technology in design and art. So I want to explore more about design and technology.

Honestly, I start to hear about arduino just recently, before I have no clue about this green board..Then, my friend told me that there are so many projects can be finished with arduino, especially those installations. So I registered this Pcomp class to explore more about what arduino can do. I know there are many students who have already got so many experiences about arduino, so hopefully, I can catch up and do some exciting installations by using arduino!



TLC5940 Experiments

The TLC5940 is a 16-channel, constant-current sink LED driver.  Each channel has an individually adjustable 4096-step grayscale PWM brightness control and a 64-step, constant-current sink (no LED resistors needed!).  The PWM on the TLC5940 works by counting the number of GSCLK pulses; a setting of 2048 will mean the LED stays on for 2048 pulses and then turns off for the rest of the cycle.  After 4096 pulses, the counter needs to be reset by a pulse on BLANK.


Link to vimeo

light + tone – hw-w2


This is a simple sound instrument using two light sensors (one for tone and one for rhythm)  + a speaker + RGB LED connected to the whole circuit that shows the behavior of sound by changing color and pace.

this video shows the change in tone using the light dimmer at home

this one shows the change in beat using the iPhone flashlight (not perfect)

Click below to see the code

Continue reading

Roula – Intro

roulaI am Roula, second-year MFADT. I’m from Beirut, Lebanon. I have BA in Architecture and Design from the American University of Beirut and a background in fine arts. I’m interested in topics such as: cinematic architecture, notions of time and space, extensions of the human body, real and digital identity, and wearable technology. For my thesis I am studying the areas of speculative design and design fiction — I want to explore the relationship of design objects within scenarios of dystopian futures to understand the human connection to technology.  So I will be looking at kinetics and mechanics in the conceptualization of these objects and worlds. Pcomp! Here’s a link to my website.

HW for week2




With the Arduino, you can control the lights. When you press the switch, the circuit is completed, and the light will be turned on. The red light and the green light will blink in turn.

I’ve tried two codes to make them blink in different ways.  So, I took two videos of them.

I don’t know why I cannot use the code snippets, so I just put one of my code here. I will put it into the code snippets, if it could work.

int led1=7;
int led2=6;
void setup()
void loop()



LED Music

For the “make something light up” homework, I decided to try and make some LEDs light up with a song.

With the help of an instructables tutorial and the Minim Library in Processing I created a circuit (schematic below), and detected the bass, snare, and hat sounds in a song and had the LEDs light up accordingly.

At the time of this post the Code Snippets thing isn’t working so I will post the code used whenever that is fixed.


IMG_20140907_175225Screen Shot 2014-09-07 at 5.50.12 PM


Week 2: RGB-LED w/ Accelerometer

The LED’s color changes based on orientation of accelerometer.

Watch pretty lights change as I rotate by Arduino.

//reg-led digital pins
int R = 11;
int G = 10;
int B = 9;

//accelerometer analog pins
int Xout = 0; // select the input pin for the sensor
int Yout = 1;
int Zout = 2;

//accelerometer variables
int xVal = 0; // variable to store the value coming from the sensor
int yVal = 0;
int zVal = 0;

int scaledValue;

void setup(){
//”AREF” pin – gives specific/precise readings
analogReference(EXTERNAL); // use AREF for reference voltage

void loop(){

xVal = analogRead(Xout); // read the value from the sensor
//Serial.println(xVal); //0-1023 Val – find lowest & highest values to map
analogWrite(R,map(xVal, 390,620, 0,255));//0-255 rgb

yVal = analogRead(Yout); // read the value from the sensor
//Serial.println(map(yVal, 390,630, 0,255));
analogWrite(G,map(yVal, 390,630, 0,255));

zVal = analogRead(Zout); // read the value from the sensor
//Serial.println(map(zVal, 390,640, 0,255));
analogWrite(B,map(zVal, 390,640, 0,255));