This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
notes:c4eng:fall2024:projects:wus2 [2024/11/20 23:26] – [project] dprado | notes:c4eng:fall2024:projects:wus2 [2024/11/21 03:25] (current) – [project] cnicho20 | ||
---|---|---|---|
Line 16: | Line 16: | ||
int Ds4 = 311; // D#4 / Eb4 | int Ds4 = 311; // D#4 / Eb4 | ||
which corresponds to the C and D notes of the 4th musical octave, including all their sharp and flat variations. Create 2 arrays, one of which will include the notes of a musical piece, and the other will contain the duration of the musical notes. In 4:4 time signature, I set a quarter note at 250ms. a half note as 500ms, etc. Then I called the playTone functions with the arrays as the arguments, and told the pi to begin playing the function when the button is pressed. For the sake of simplicity, I also initialized variables for note duration, with Q as a quarter note, H has a half note, etc. | which corresponds to the C and D notes of the 4th musical octave, including all their sharp and flat variations. Create 2 arrays, one of which will include the notes of a musical piece, and the other will contain the duration of the musical notes. In 4:4 time signature, I set a quarter note at 250ms. a half note as 500ms, etc. Then I called the playTone functions with the arrays as the arguments, and told the pi to begin playing the function when the button is pressed. For the sake of simplicity, I also initialized variables for note duration, with Q as a quarter note, H has a half note, etc. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | =================Project================ | ||
+ | This connected circuit contains a joystick, a active buzzer and a LED. The whole thing is ran by the joystick moving in the y direction. The joystick is a two axis analog device that allows for directional movement and a button press feature. When the joystick is moved in the Y direction, the active buzzer and LED light are both turned on but only as long as the joystick is being pushed/held in the y direction. The LED light is a simple output device that produces light when a electric current flows through it. While the active buzzer is a component that emits a sound when powered. unlike a passive buzzer, an active buzzer has an internal oscillator that makes it easier to control, meaning when a voltage is there it will generate sound. The goal and inspiration for this project was a hockey goal buzzer and light. | ||
+ | {{: | ||
+ |