flash assignment - commlab
This is the first work using flash that i”ve ever made . sooo, simple!!
I lost fla file of the work. So, I took the flash movie on the camera. :p
This is the first work using flash that i”ve ever made . sooo, simple!!
I lost fla file of the work. So, I took the flash movie on the camera. :p
Amanda and I drew the pig and tear of the pig’s eye on the paper. Another two eyes on the paper moved. Each shoot of the scenes made drawing, erasing, and moving was captured using “Imotion.”
Marshall Mcluhan is, I think, an incredible theorist because he could see the future and logically described what we are doing now not exactly though. (Even though technology and media he mentioned was out of date ranging from alphabet to radio, the latest media like radio was new at that time.) To grasp the most his idea, hot and cool media concept is important because, depending on thins standard, we can understand the attributes of some media. But, still I am not sure what the cool and hot concept is and how I can divide which one is which. Actually, it’s too hard. New is gone as an old fashioned. It has been changed.
Through all chapters, now, the word ‘numb’ is in my mind. Like ‘Orality and literacy’, I agree we, human, are getting around by audible environment. Our sense is awaken. We automatically experienced the extension of our sense to this technological society. This concept meets my thought what is the end of the sense? I mean people can’t satisfy easily and threshold is getting higher(a crucial movie is the best example). They want more. Even though there was always meeting of two media for a moment of freedom from numbness in the media history, I feel this basic concept of the media from Mcluhan takes hold for years and our sense could be off or could be meet each other.
———This is the code making gragh based on analog data. When you want to see the data as a visualised way, this is very useful method.
I think understanding serial with this code might be useful as well. —————
Processing Code:
import peocessing.serial.*; // call the serial library
Serial myPort; // the serial port
// initial varialbles
int [] sensorValue = new int[3];
int hposition = 0;
void setup(){
// size
size(400,300);
// list all the avilable serial ports
println(Serial.list());
// open whatever port you are using
myPort = new Serial(this, Serial.list[1], 9600);
myPort.bufferUntil(’\r’);
// set initial background
background(0);
}
void draw(){
// gragh fuction call with if statement
if(sensotValues[0] >=0 && sensorValues[1]>=0 && sensorValues[3] >=0){
gragh(sensorValues[1]);
}
}
void serialEvent(Serial myPort){
Srting serialString = myPort.readStringUntil(’\n’);
if(serialString != null){
String[] numbers = split(serialString,”,”);
// put in the array using split fuction
for(int i=0; i< numbers.length; i++){
sensorValues[i] = int (numbers[i]);
print(sensorValues[i] + “\t”);
}
println();
}
}
void gragh(int numberToGraph){
// draw the line
stroke(0,255,0);
line(hPosition, height, hPosition, height-numberToGraph);
// at the ecge of screen, go back to the beginning
if(hPosition >= width){
hPosition =0;
background(0);
}
else{
hPosition++;
}
}
Arduino code:
void setup(){
Serial.begin(9600);
}
void loop(){
int x = analogRead(3);
delay(10);
int y = analogRead(4);
delay(10);
int z = analogRead(5);
Serial.print(x, DEC);
Serial.print(”, “);
Serial.print(y,DEC);
Serial.print(”, “);
Serial.print(z, DEC);
}
by Amanda, Matt, and me.
So fun project~ We recorded two cat sound (Matt and I) and Gollum’s voice(Amanda).
You can hear my laugh just before starting Gollum’s voice.
The circuit that consists of the two analog sensor pins 0 and 1 and one digital pin2
# flex sensor is not sensitive to range. so, I changed flex sensor to second potentiameter.
Through the Hyperterminal, any bytes I typed was shown in the serial moniter. The BYTE sent the raw binary value of the byte, the DEC sent the decimal vlaue that an ASCII-encoded.
< Arduino Code>
int firstSensor = 0; // first analog sensor
int secondSensor = 0; // second analog sensor
int thirdSensor = 0; // digital sensor
int inByte = 0; // incoming serial byte
void setup()
{
// start serial port at 9600 bps:
Serial.begin(9600);
pinMode(thirdSensor, INPUT);
}
void loop()
{
// if we get a valid byte, read analog ins:
if (Serial.available() > 0) {
// get incoming byte:
inByte = Serial.read();
Serial.print("I received");
Serial.println(inByte,DEC);
-> “” and decimal value that I type is printed
// read first analog input, divide by 4 to make the range 0-255:
firstSensor = analogRead(0)/4;
// delay 10ms to let the ADC recover:
delay(10);
// read second analog input, divide by 4 to make the range 0-255:
secondSensor = analogRead(1)/4;
// read switch, multiply by 255
// so that you're sending 0 or 255:
thirdSensor = 255 * digitalRead(2);
// send sensor values:
Serial.print(firstSensor, BYTE);
Serial.print(secondSensor, BYTE);
Serial.print(thirdSensor, BYTE);
}
}
* Because of Serial.available(), data is sent only when I type the value.
*int Serial.read() : reads incoming serial data
an int, the first byte of incoming serial data abailable(or -1 if no data is available)

*int Serial.available() : get the number of bytes (characters) available for reading over the serial port.
the number of bytes are available to read in the serial buffer, or 0 is none are avilable. If any date has come in, Serial.avilable() will be greater than 0. The serial buffer can hold up to 128 bytes.
<< Processing Code>>
import processing.serial.*;
int bgcolor; // Background color
int fgcolor; // Fill color
Serial port; // The serial port
int[] serialInArray = new int[3]; // Where we'll put what we receive
int serialCount = 0; // A count of how many bytes we receive
int xpos, ypos; // Starting position of the ball
boolean firstContact = false; // Whether we've heard from the microcontroller
void setup() {
size(256, 256); // Stage size
noStroke(); // No border on the next thing drawn
// Set the starting position of the ball (middle of the stage)
xpos = width/2;
ypos = height/2;
// Print a list of the serial ports, for debugging purposes:
println(Serial.list());
// I know that the first port in the serial list on my mac
// is always my Keyspan adaptor, so I open Serial.list()[0].
// On Windows machines, this generally opens COM1.
// Open whatever port is the one you're using.
port = new Serial(this, Serial.list()[1], 9600);
-> since Port number is 1, I have to change the number 0 to 1.
port.write(65); // Send a capital A to start the microcontroller sending
}
void draw() {
background(bgcolor);
-> Defalt value is 0.So,background is black. changing value make circle to be shown
fill(fgcolor);
// Draw the shape
ellipse(xpos, ypos, 20, 20);
// If no serial data has beeen received, send again until we get some.
// (in case you tend to start Processing before you start your
// external device):
if (firstContact == false) {
delay(300);
port.write(65);
}
}
void serialEvent(Serial port) {
// if this is the first byte received,
// take note of that fact:
if (firstContact == false) {
firstContact = true;
}
// Add the latest byte from the serial port to array:
serialInArray[serialCount] = port.read();
serialCount++;
// If we have 3 bytes:
if (serialCount > 2 ) {
xpos = serialInArray[0];
ypos = serialInArray[1];
fgcolor = serialInArray[2];
// print the values (for debugging purposes only):
println(xpos + "t" + ypos + "t" + fgcolor);
// Send a capital A to request new sensor readings:
port.write(65);
// Reset serialCount:
serialCount = 0;
}
}
The lab is about servo motor based on analog output concept. Unlike digital output, analog output makes the data range. Lighting dimmer and motor controllers are common examples.
microcontrollers can only produce a high voltage(5V) or low voltage(0V). Thus, we use PWM( pulse width modulation) which is from regular intervals instead. If the length of high time is half total time, the duty cycle(the ratio of length of high time) is 50% which is the half of the total voltage.
(The pulsewidth - usually a very small time, on the order of a few microseconds or milliseconds at most.
Sercomotors - motors with a combination of gears and an embedded potentiometer that allows you to set their position fairly precisely within a 180-degree range. There are three wires(power, ground, control). connect the +5V directly to a 5V power source that can supply at least one amp of current (don’t try to power the motor from the microcontroller, it hasn’t got enough power) Ground it to the same ground as the microcontroller. And attach the control pin to a pin on the microcontroller. Then you need to send a series of pulses to the control pin to set the angle. The longer the pulse, the greater the angle. -from Tom’s pcomp page-)
To move motor automatically from 0 to 180,
int servoPin =2; //펄스 넣어주는 곳
int minPulse = 500; // 최소한의 펄스
int maxPulse = 2500; // 최대펄스
int pulse = 0; // 펄스 핀 0
long lastPulse = 0; //
int refreshTime = 20;
int analogValue = 0;
int analogPin = 0;
void setup(){
pinMode(servoPin, OUTPUT);
pulse = minPulse;
Serial.begin(9600);
}
void loop(){
if (pulse <=minPUlse) {
// start increasing the pulse pulseChange = 1;
}
if (pulse >= maxPulse) {
// start decreasing the pulse
pulseChange = -1;
}
pulse = pulse + pulseChange;
// Serial.println(analogValue);
//millis()의 개념 ,처음에는 0, 1초가 되면 1000, 그래서 라스트 펄스도 처음에는 0, 시간에 지나고
// 20보다 크면 실행하고 20보다 큰수를 넣어준다.
if(millis() - lastPulse >= refreshTime){
//이 서보모터는 20의 시간이 필요하다
digitalWrite(servoPin, HIGH);
delayMicroseconds(pulse);
digitalWrite(servoPin,LOW);
lastPulse = millis();
}
}
Corey, Kim, and Me went to the Washington Park for collecting sounds. We brought the shot gun microphone and audio recorder. It was amazing time because shot-gun mic was totally different experience with another one. When I just hold the mic toward anywhere. It grasped sharp sound pointed microphone. swing, dogs barking, and phone conversation…. etc.
Using Audacity, we made a collage of sound.