User Tools

Site Tools


notes:c4eng:fall2022:projects:sss0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
notes:c4eng:fall2022:projects:sss0 [2022/09/27 04:46] – [ARRAYS] added a set of quotes around int rgerbinonotes:c4eng:fall2022:projects:sss0 [2022/10/04 13:34] (current) – [PARTS] lbrant2
Line 1: Line 1:
 =====BACKGROUND===== =====BACKGROUND=====
 +
 +For this project, we will be experimenting with sound to create a song. In this project we will learn what an active and passive buzzer is. An active buzzer has a built in oscillator to generate sound by itself with a DC (direct current) power supply. A passive buzzer does not have a built in oscillator to generate sound, instead it needs an AC (alternating current) audio signal to generate sound. In this project, we will be using a passive buzzer to create the sound that will be used to play the song we create. 
 ====ARRAYS==== ====ARRAYS====
  
Line 5: Line 7:
  
  
-The first element in an array has an index of 0, the second element has an index of 1, and so on. Declaring an array variable is done similarly, yet slightly different than that of other variables. With other variables, they might be declared like this:+The first element in an array has an index of 0, the second element has an index of 1, and so on. Declaring an array is done similarly, yet slightly differently, than that of other variables. With other variables, they might be declared like this:
  
 <blockquote>int index = 0;</blockquote> <blockquote>int index = 0;</blockquote>
Line 12: Line 14:
  
  
-For arrays, however, rather than declaring an array data type or some such, we instead declare the data type of the elements that will //populate// our array, appending square brackets to the end of the variable name to indicate an array, with a number within those brackets to signify the number of elements in, or size of, that array (no number means 0). For example, from vcc0:+For arrays, however, rather than declaring some sort of array data type, we instead declare the data type of the elements that will //populate// our array, appending square brackets to the end of the variable name to indicate an array, with a number within those brackets to signify the number of elements in, or size of, that array (no number means 0). Using vcc0 as an example:
  
 <blockquote>int pin[NUM_PINS];</blockquote> <blockquote>int pin[NUM_PINS];</blockquote>
  
-The name of this array is called "pin" and holds "NUM_PINS" number of elements, and the data type of those elements is "int."+The name of this array is called "pin" and holds "NUM_PINS" number of elements, and the data type of those elements is "int".
  
  
-Setting the value of an element within an array after the array has been declared is similar to setting the value of any other variable. The only difference is that, for an array, the index of the element being assigned must be within square brackets appended to the end of the name of the array. In the "pin" array, for example:+Both calling and assigning the value of an element within an array after the array has been declared is once again done similarly, yet slightly differently, than that of other variables. The only difference is that, for an array, the index of the element being assigned must be within square brackets appended to the end of the name of the array. Once again using vcc0 as an example, for assigning:
  
-<blockquote>pin[2] = 4;</blockquote>+<blockquote>pin[2] = 3;</blockquote>
  
-This will assign the third value (index = 2) of the array "pin" to have a value of "4," provided that the array has a size of at least three elements.+This will assign the third value (index = 2) of the array "pin" to have a value of "3"provided that the array has a size of at least three elements.
 =====ELECTRONICS===== =====ELECTRONICS=====
 =====PARTS===== =====PARTS=====
 {{:notes:c4eng:fall2022:projects:buzzerparts.png|}} {{:notes:c4eng:fall2022:projects:buzzerparts.png|}}
  
 +A Passive buzzer is also known as Transducer, it uses AC power that is driven through an onboard circuit. The frequency is dependent on the input square wave signal, as it changes so does the frequency, hence offering more variance in its usage. 
  
 +Transistors are electronic components that are used in circuits for either amplifying or switching electrical signals or power and allowing them to be used in a large array of electronic devices. A transistor has two PN diodes combined back to back. Also, it has three terminals named emitter, base, and collector. The fundamental idea and physical law behind a transistor are that it should let you control the flow of current over one channel by varying the intensity of a much smaller current flowing through another channel.
 =====CIRCUIT===== =====CIRCUIT=====
 {{:notes:c4eng:fall2022:projects:buzzercircuit.png|}} {{:notes:c4eng:fall2022:projects:buzzercircuit.png|}}
notes/c4eng/fall2022/projects/sss0.1664254014.txt.gz · Last modified: 2022/09/27 04:46 by rgerbino