Author Archives: Shiny Lee

Final Presentation

Here if the file for my presentation: ccfinal

Thank you so much for a great semester!

Leave a comment

Filed under Homework

Node Assignment

I made my pumpkin face worked in Node.

Here is the video: link

Below is the Arduino code:

int led1 = 10;
int led2 = 11;
int led3 = 12;
int led4 = 13;//b
int led5 = 9;
int led6 = 8;
int led7 = 7;
int led8 = 6;//r
int buzzerPin = 2;
void setup() {
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(led5, OUTPUT);
pinMode(led6, OUTPUT);
pinMode(led7, OUTPUT);
pinMode(led8, OUTPUT);
pinMode(buzzerPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
if (Serial.available() > 0) {
char inputData = Serial.read();
if(inputData==’1′){
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, HIGH);
digitalWrite(led5, LOW);
digitalWrite(led6, LOW);
digitalWrite(led7, LOW);
digitalWrite(led8, LOW);
tone(buzzerPin, 500, 300);
}
if(inputData==’2′){
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
digitalWrite(led5, LOW);
digitalWrite(led6, LOW);
digitalWrite(led7, LOW);
digitalWrite(led8, HIGH);
tone(buzzerPin, 800, 200);
}
if(inputData==’3′){
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
digitalWrite(led4, HIGH);
digitalWrite(led5, HIGH);
digitalWrite(led6, HIGH);
digitalWrite(led7, HIGH);
digitalWrite(led8, LOW);
tone(buzzerPin, 400, 800);
}
if(inputData==’4′){
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
digitalWrite(led4, LOW);
digitalWrite(led5, HIGH);
digitalWrite(led6, HIGH);
digitalWrite(led7, HIGH);
digitalWrite(led8, LOW);
tone(buzzerPin, 1000, 500);
}
}
}

 

Node.Js code:

var serialport = require(“serialport”);
var SerialPort = serialport.SerialPort;

var led = 1;
var myserial = new SerialPort(“/dev/tty.usbmodem1421”,{
baudrate: 9600
});

myserial.on(‘open’,function(){
setInterval(testLEDwithBuzzer,500);

});

function testLEDwithBuzzer(){

led = Math.round((Math.random(0,1)*10) %3 +1);
console.log(‘send command for led with buzzer=’ + led);
myserial.write(led.toString());}

});

Leave a comment

Filed under Homework

Openframeworks HW

For the assignment, I used the billboard example and  made some changes such as the object and the color.  I will continue to explore it and try to combine it with my motion graphics project.

 

Leave a comment

Filed under Homework

Midterm Assignment

Please click here: presentation

bk2 copybk4 copy

Also, I used arduino and node to make a jack-o-lantern face for the halloween.
The video is here

 

 

Leave a comment

Filed under Homework

Arduino HW2

#1 LED + Pressure Sensor
[Video]
Please click here.

[Fritz]
LEDPR

[Code]
int brightness = 0;
int pinFlex = 0;

void setup() {
pinMode(9, OUTPUT);
Serial.begin(9600);
}
void loop() {

int sensorValue = analogRead(pinFlex);
pinFlex = analogRead(0);
Serial.println(pinFlex);
brightness = map(pinFlex, 0, 1024, 0, 255);
analogWrite(9, brightness);
}

#2 LED + Keyboard Input
[Video]
Please click here.

[Fritz]
ledheart

[Code]
void setup() {
Serial.begin(9600);
for (int ledPin = 2; ledPin 0) {
int inByte = Serial.read();

switch (inByte) {
case ‘h’:
digitalWrite(2, HIGH);
break;
case ‘e’:
digitalWrite(3, HIGH);
break;
case ‘a’:
digitalWrite(4, HIGH);
break;
case ‘r’:
digitalWrite(5, HIGH);
break;
case ‘t’:
digitalWrite(6, HIGH);
break;
default:

for (int ledPin = 2; ledPin < 7; ledPin++) {
digitalWrite(ledPin, LOW);
}
}
}
}

Leave a comment

Filed under Homework

Arduino HW

#1  LED

[Video]

Please click here

[Fritz]

3led

[Code]

int led = 13;
int led2 = 12;
int led3 = 11;
void setup() {
  pinMode(led, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);
}
void loop() {
  digitalWrite(led, HIGH);
  delay(1000);
  digitalWrite(led, LOW);
  delay(1000);
  {
  digitalWrite(led2, HIGH);
  delay(1000);
  digitalWrite(led2, LOW);
  delay(1000);
  {
  digitalWrite(led3, HIGH);
  delay(1000);
  digitalWrite(led3, LOW);
  delay(1000);
}}

}

                       
#2 LED + Button

[Video]

Please click here

[Fritz]

ledbut

[Code]

int led = 13;
int led2 = 12;
int but =2;
int but2=4;
int buttonState= 0;
int button2State= 0;

void setup() {
pinMode(led, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(but, INPUT);
pinMode(but2, INPUT);
}

void loop(){
buttonState = digitalRead(but);
button2State = digitalRead(but2);

if (buttonState == HIGH) {
digitalWrite(led, HIGH);
digitalWrite(led2, LOW);
}
else if (button2State == HIGH) {
digitalWrite(led2, HIGH);
digitalWrite(led, LOW);
}
else {
digitalWrite(led2, LOW);
digitalWrite(led, LOW);
}}

Leave a comment

Filed under Homework

API HW – Hsin-Ning Lee

Last week’s class was very helpful. I learned more about API. I also went to the review session on last friday.

For this assignment, I explored Google Maps API. I called the map and marked the exact location of Parsons.

Here is the link:

http://a.parsons.edu/~leeh578/map1.html

Below is my code:

<!DOCTYPE html>
<html>
<head>
<title>Google Map API</title>
<meta name=”viewport” content=”initial-scale=1.0, user-scalable=no” />
<style type=”text/css”>
html { height: 80% }
body { height: 80%; width: 80%; margin: 100; padding: 0 }
#map-canvas { height: 100% }
</style>
<script type=”text/javascript”
src=”https://maps.googleapis.com/maps/api/js?key=AIzaSyAPXmMRaQKWBzG37Y6SJUw4uO-adVxLTyw&sensor=false”&gt;
</script>
<script type=”text/javascript”>
function initialize() {

var mapOptions = {
center: new google.maps.LatLng(40.735257,-73.994424),
zoom: 16,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById(“map-canvas”),
mapOptions);

var marker = new google.maps.Marker({
position: map.getCenter(),
map: map,
title: ‘Parsons The New School for Design’
});

}
google.maps.event.addDomListener(window, ‘load’, initialize);
</script>
</head>
<body>
<br>
<h1>Parsons The New School for Design</h1>
<br>
<div id=”map-canvas”/>
</body>
</html>

Leave a comment

Filed under Homework

Kinetic HW

Helen posted the homework for our group! Please view here.

Leave a comment

Filed under Homework

Canvas HW – Hsin-Ning Lee

Here is the link: http://a.parsons.edu/~leeh578/cclabhw02.html

You can click on the button to water the flowers.

I learned gradient, curve, and onclick function from the assignment. I also found an extension for Illustrator to help me draw the flowers. This is where you can download the extension: http://drawscri.pt

Screen Shot 2013-09-11 at 0.39.08 Screen Shot 2013-09-11 at 0.39.13

Below is the code.

Continue reading

Leave a comment

Filed under Homework

Madlib HW

<!DOCTYPE html>
<html>
<head>
<title>Madlibs</title>
</head>
<body>
<script type=”text/javascript”>

//Madlibs HW Hsin-Ning Shiny Lee

console.log(“Madlibs”);

var word1= “Big”;
var word2= “Apple”;
var word3= “city”;
var word4= “changes”;
var word5= “consistently”;
var word6= “never”;
var word7= “sleeps”;
var word8= “Tokyo”;
var word9= “gets”;
var word10= “dark”;
var word11= “always”;
var word12= “works”;
var madlibs= (“The “+word1+” “+word2+” is a “+word3+” that “+word4+” “+word5+” and “+word6+” “+word7+”.”);
var madlibs2= (word8+” is a “+word3+” that “+word11+” “+word12+” and “+word6+” “+word9+” “+word10+”.”);

console.log(madlibs);
console.log(madlibs2);

</script>
</body>
</html>

 

1 Comment

Filed under Homework