This week we played with analog input and output (or Pulse Width Modulation), testing the concepts on a speaker and a Servo motor. I also tried to do something ‘more creative’ with the speaker, so I created a little game called:
Can you guess the song in less than 10 notes?
With the help of Henry’s composition skills and Alexandra’s, Dre’s and Alfonsette’s song guessing abilities I was able to test out the game:
Hurray! Collectively the team guessed all the songs. Although I wonder how do I prompt the users to just press the button once, as opposed to continuing to hold it. Oh, and here is the set up of the circuit:
I was able to complete this week’s labs, although many questions remain. And my microcontroller broke at the end :(. Here is a lab highlight: potentiometer controlling the Servo motor..
!remaining questions!
- What does a transistor actually do and how does it work? What do the different pins mean?
- What is the speaker set up below? Which direction does the electricity flow in the speaker?
- How does one connect an audio jack?
- What does a capacitor do and when do we need to use it?
- A potentiometer doesn’t have a pulldown resistor even though it is a variable resistor. Why not?
- sizeOf(melody)/sizeOf(melody[0]) didn’t work when I used it to determine the length of the notes array. Why not?