Here if the file for my presentation: ccfinal
Thank you so much for a great semester!
Here if the file for my presentation: ccfinal
Thank you so much for a great semester!
Filed under Homework
I made my pumpkin face worked in Node.
Here is the video: link
Below is the Arduino code:
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());}
});
Filed under Homework
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.
Filed under Homework
Please click here: presentation
Also, I used arduino and node to make a jack-o-lantern face for the halloween.
The video is here
Filed under Homework
#1 LED + Pressure Sensor
[Video]
Please click here.
[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.
[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);
}
}
}
}
Filed under Homework
#1 LED
[Video]
Please click here
[Fritz]
[Code]
#2 LED + Button
[Video]
Please click here
[Fritz]
[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);
}}
Filed under Homework
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”>
</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>
Filed under Homework
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
Below is the code.
Filed under Homework
<!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>