Assignment 7: Simple Instrument

I have created a simple instrument consisting of three different notes (B, A, G), in order to play “rain is falling down” music : 

Rain in falling down – BB AA G 
Rain is falling down – BB AA G
Pitter patter, pitter, patter – BB AA BB AA
Rain is falling down – BB AA G 
 
I had an issue with my first code with declaring my integer. So here is my code that didn’t work. 
 

So I changed my code a bit, and this is my new code. 

 

Schematic : 

Assignment 6 : Buzzer, Servo Motor

For this assignment, I made a music sequence of the Harry Potter Theme song. After playing the song, the servo motor would move to 90 degrees, 180 degrees, and then to 10 degrees. One thing I found very confusing was using numbers to express different music notes. So I built a struct where I initialized the music notes and length. Another thing I was confused was where to put my struct. I figured it out but I still am kind of confused. However, in general it was a very interesting assignment.  

Code: 

 

Schematic: 

Assignment 4

Part I:

Fade tutorial and Fading example in Arduino both accomplished the same thing. They both successfully make LED in pin to fade in and out. The difference between two is the code. In Fade, and if() function was used to check the brightness in between 0 to 255 and changed the fadeAmount. However, Fading example in Arduino used two for loops. The intensity was changed in each loop. First loops increased the brightness by 5 until it reached up to 255 and the second loop decreased the brightness by 5 until it reached zero, which is followed by the loop restarting.   

Part II: 

Part III: 

 

Assignment 3: AnalogWrite in Setup and Loop

Code: 

/*Created by Ju Hee Noh

Sept, 13th 2017*/

int greenLED = 3;

int yellowLED = 5;

int outputValue = 0;

void setup() {

analogWrite(green, 400);

delay(500);

analogWrite(green, 350);

delay(500);

analogWrite(green, 300);

delay(500);

analogWrite(green, 250);

delay(500);

analogWrite(green, 200);

delay(500);

analogWrite(green, 150);

delay(500);

analogWrite(green, 100);

delay(500);

analogWrite(green, 50);

}

void loop() {

analogWrite(yellow, 300);

delay(1000);

analogWrite(yellow, 250);

delay(1000);

analogWrite(yellow, 150);

delay(1000);

analogWrite(yellow, 100);

delay(1000);

analogWrite(yellow, 50);

delay(1000);

analogWrite(yellow, 25);

delay(1000);

analogWrite(yellow, 0);

delay(1000);

}

 

Schematics: 

Assignment 2: LDR, 3 LEDS, and if clause

I have made a circuit consisting of: 

  • three LEDs (Blue, Green, Yellow)
  • 10 wires 
  • three 330 Ω Resistors 
  • one 10K Ω Resistor 
  • one red board 
  • on bread board 
  • one LDR 

Based on the strength of light shining into LDR one of three lights shines. 

Under a normal room light the green LED shines. If there is less amount of light given by covering the LDR, the yellow LED lights up. Lastly when a strong light is given blue LED lights up. 

Code: 

void setup() { Serial.begin(9600);

pinMode(10, OUTPUT);

pinMode(11, OUTPUT);

pinMode(12, OUTPUT);

}

void loop() { int sensorValue = analogRead(A0);

Serial.println(sensorValue);

if(sensorValue > 900){

digitalWrite(10, HIGH);

digitalWrite(11, LOW);

digitalWrite(12, LOW);

}

else if(sensorValue < 900 && sensorValue > 600){

digitalWrite(10, LOW);

digitalWrite(11, HIGH);

digitalWrite(12, LOW);

}

else {//(sensorValue < 600){

digitalWrite(10, LOW);

digitalWrite(11, LOW);

digitalWrite(12, HIGH);

}

delay(1);

}

Schematic: 

Assignment 1: LED Pixel Display, The Chair Switch, Blink Switch

There are two switches I made for the first assignment. The first switch is “The Chair Switch”. It consists of a chair that has foil wrapped around in the lower back area, and a badged with a foil that could be connected to the chair when a person sits on the chair.

The second switch is “Blink Night Light Switch”. There are two parts in this switch : a thin layer of foil that goes on the under eye area, and a pair of lashes with foil layer on top. If the person closes his or her eyes the light would turn on.

This is an LED Pixel Display made with Arduino. It can not only display lights but can also show certain notifications, stock datas and etc.