-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passive Buzzer Documentation #208
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
cf45fee
Began process for documentation. Needs functionality information.
adelgadoj3 e82d4f4
Added further information about functionality and overview.
adelgadoj3 d5bf67f
Incorporated requested changes: javadoc and example controller
adelgadoj3 5728c7c
Implemented requested changes. buzzer-SD.png was added in with active…
adelgadoj3 dc05612
left out index.adoc fix for passive adoc link. Implemented
adelgadoj3 0ebf42e
Touch switch was not incorporated into the file.Causing two links to …
adelgadoj3 ccb11db
Didn't resolve conflict. Removed link.
adelgadoj3 578c8b4
Merge branch 'develop' into 198-passive-buzzer-documentation
adelgadoj3 617fa16
Merge branch 'develop' into 198-passive-buzzer-documentation
adelgadoj3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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). | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add constructors and methods senction with passiveBuzzer javadoc link. |
||
===== 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] | ||
adelgadoj3 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
---- |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this image was not uploaded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the image in the active buzzer documentation issue.