What a week...
For the lab, I used potentiometer to replace the sensors since I didn't have any sensors in hand. It really did take such a long time to figure out how the whole thing works, I honestly don't even know If I actually understand it or not.
This was the first lab I did and I already had problems.. After asking around, I knew that I completely forgot the concept of "delay", that was why the servo was jiggling.
After the servo, I was trying to use potentiometer on the speaker to control the frequency, which surprisingly worked the first time I tried it. From there I kind of want to use the speaker for the creative project. I started doing some research on how to make a birthday card that is controlled by a button with a programmed melody in Arduino.
After having the basic ideas, I started trying out the melody lab practice and tried to make a folded card with an embedded button in it.
After having the card with the button connected to the arduino board with a speaker output, I have found the melody for the "happy birthday song". It was ok to figure out and match the note and note duration, however it was extremely difficult to understand the correct delay for the song to be effectively played. so I ended up pulled something from the arduino reference and it eventually worked. I played around with the note duration to make the melody faster and slower, but what I mostly wanted to do is to create an if statement for the button to control the on and off of the melody. Eventually, that did not work at all, I will have to dig in more and ask around.