Week 3 - Lab Documentations

This week’s lab are mostly for more creative uses on FSR to connect the sensor to other components like speakers, servos to generate more interactions.

Lab: Tone Output Using An Arduino
-Connect the Sensors and the Speaker, the range of the tone can be changed, and as the 440Hz represents higher pitch, I changed to 200Hz, and the pitch is lower. 
-It was very interesting to know that if using AnalogWrite() for the output pin, the on-off ratio can be changed but not the frequency of the sound, therefore it will continuously to provide a same tone but not a different tone. Therefore in this lab, the tone() was used.

Play Tones:
 -100 Hz to 1000 Hz - (sensorReading 100 - 1000) can be changed to different range so that the tune will be different each time.
-To store frequency preset into local variable, which can be defined as frequency, and then picked out the frequency to use tone() to play to the pin, and to the speaker.

Play it Loud: -by adding a transistor, in this case,  it is TIP120 transistor with a 100-ohm resistor.

Program it & Creative one:

-”The pitches.h file includes constants that give you the pitches for a standard western scale. To include them in your sketch, click the New Tab button on the toolbar and create a new tab called pitches.h.”

-The note and the sound will changed when I changed the NOTE_A1 / NOTE_B2 / NOTE_C5 into different numbers, which represents the melody of the output of the speaker. And note that ABCDEFG represents different sets of melody.

Since I do not have that much FSR to use as my notes, I tricked a little bit and divied the videos into three parts and combined it to play the melody:

Lab: Servo Motor Control with an Arduino

-Program the Microcontroller 2:
If I change my resistor range to 900, it starts to be unreliable and vibrating. And the range of it is 600, it starts to moving accourdingly with the my pushing force towards the FSR.