-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Began process for documentation. Needs functionality information. * Added further information about functionality and overview. * Incorporated requested changes: javadoc and example controller * Implemented requested changes. buzzer-SD.png was added in with activebuzzer issue. Once that is merged the img conflict should resolve here. * left out index.adoc fix for passive adoc link. Implemented * Touch switch was not incorporated into the file.Causing two links to be on the same line. Should resolve conflict * Didn't resolve conflict. Removed link. --------- Signed-off-by: adelgadoj3 <[email protected]>
- Loading branch information
1 parent
6829291
commit ac620b3
Showing
4 changed files
with
105 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
...icronaut-utils/src/docs/asciidoc/components/outputComponents/passivebuzzer.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
:imagesdir: img/ | ||
|
||
ifndef::rootpath[] | ||
:rootpath: ../../ | ||
endif::rootpath[] | ||
|
||
ifdef::rootpath[] | ||
:imagesdir: {rootpath}{imagesdir} | ||
endif::rootpath[] | ||
|
||
|
||
|
||
==== Passive Buzzer | ||
|
||
[.text-right] | ||
https://github.com/oss-slu/Pi4Micronaut/edit/develop/pi4micronaut-utils/src/docs/asciidoc/components/outputComponents/passivebuzzer.adoc[Improve this doc] | ||
|
||
|
||
|
||
===== Overview | ||
This section provides details of the Passive Buzzer, including the components and assembly instructions. The Passive Buzzer emits various frequencies, as described by the code, to play music or many other frequencies. | ||
|
||
===== Components | ||
* 1 x RaspberryPi | ||
* 1 x Breadboard | ||
* 1 x T-extension Board | ||
* 1 x Passive Buzzer | ||
* 6 x Jumper wires | ||
* 1 x Resistor (1KΩ) | ||
* 1 x S8550 PNP Transistor | ||
* Power source (appropriate voltage, typically 3.3V) | ||
|
||
===== Assembly Instructions | ||
|
||
* Place the Passive Buzzer onto the Breadboard. | ||
* Place the 1KΩ resistor onto the Breadboard, must be inline with base pin of S8550 PNP Transistor. | ||
* Place the S8550 PNP Transistor onto the BreadBoard. | ||
* The Passive Buzzer will have two pins of the same length. The anode is (+) while the cathode is (-). | ||
* Connect a jumper wire from GND to (-) negative side | ||
* Connect a jumper wire from 3.3V to (+) positive side. | ||
* Connect a jumper wire from GPIO 17 to the 1KΩ resistor | ||
* Connect jumper wire from positive side to positive end of Passive Buzzer. | ||
* Connect jumper wire from negative end of Passive Buzzer to emitter pin of S8550 PNP Transistor. | ||
* Connect jumper wire from negative side to collector pin of S8550 PNP Transistor. | ||
|
||
|
||
===== Circuit Diagram | ||
Schematic Diagram | ||
|
||
image::buzzer-SD.png[] | ||
|
||
Circuit Diagram | ||
|
||
image::passive_buzzer-CD.png[] | ||
|
||
===== Functionality | ||
Use: `curl http://localhost:8080/passive-buzzer` to test the component. These following commands will test the component: | ||
|
||
* `/enable` - Turns the Passive Buzzer on. | ||
* `/disable` - Turns the Passive Buzzer off. | ||
* `/showFreq` - Displays the current frequency of the Passive Buzzer. | ||
* `/setFreq/{frequenciesFile}` - Plays a series of frequencies from a file specified by the user. | ||
* `/passBuzz` - Plays a 1 - second buzz. | ||
* `/freqIter` - Cycles through different frequencies. | ||
* `/playPiSeq` - Plays an array containing the first ten digits of pi. | ||
|
||
|
||
|
||
===== Troubleshooting | ||
- Passive Buzzer not creating sound: | ||
* Double check power source | ||
* Verify that 1K resistor is used | ||
* Verify all wires are in appropriate slots. | ||
* When using a file, verify that the file itself is scp'd to the raspberrypi (see PassiveBuzzerController for full information). | ||
|
||
===== YAML | ||
[source, yaml] | ||
|
||
---- | ||
passive-buzzer: | ||
name: passive-buzzer | ||
address: 17 | ||
pwmType: SOFTWARE | ||
provider: pigpio-pwm | ||
initial: 0 | ||
shutdown: 0 | ||
---- | ||
|
||
===== Constructors and Methods | ||
The constructor and the methods within the PassiveBuzzerHelper class can be seen in our javadoc link:https://oss-slu.github.io/Pi4Micronaut/javadoc/com/opensourcewithslu/outputdevices/PassiveBuzzerHelper.html[here]. | ||
|
||
|
||
===== Example Controller | ||
|
||
====== This controller uses the Passive Buzzer to emit sound once prompted by the commands | ||
|
||
[source, java] | ||
---- | ||
include::../../../../../../components/src/main/java/com/opensourcewithslu/components/controllers/PassiveBuzzerController.java[tag=ex] | ||
---- |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters