-
Notifications
You must be signed in to change notification settings - Fork 7
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
Need to improve LED documentation #102
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
6c8c0e3
Need to improve and add further information for this doc
adelgadoj3 bc47e3b
Updated the file with the requested changes. Still need to include th…
adelgadoj3 9d755e1
Made the requested changes to the .adoc file (Testing section with cu…
adelgadoj3 c3e685b
Provided the requested changes: bullet points, omegas, and corrected …
adelgadoj3 c549468
Merge branch 'main' into 96-led-support-controller
ruthvikm a4dd3ec
Reverted change made to LEDController. Previously added a check for L…
adelgadoj3 85a7ca7
Merge branch '96-led-support-controller' of https://github.com/oss-sl…
adelgadoj3 27d65c4
Deleted the :omega: variable at the top of the .adoc. Incorporated th…
adelgadoj3 b3b9618
Fixed the path for the image in the circuit diagram section.
adelgadoj3 29cf066
Changed led to LEDOn to resolve issue
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
27 changes: 27 additions & 0 deletions
27
components/src/main/java/com/opensourcewithslu/components/controllers/LEDController.java
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,27 @@ | ||
package com.opensourcewithslu.components.controllers; | ||
|
||
import com.opensourcewithslu.outputdevices.LEDHelper; | ||
import com.pi4j.io.gpio.digital.DigitalOutput; | ||
import io.micronaut.http.annotation.Controller; | ||
import io.micronaut.http.annotation.Get; | ||
import jakarta.inject.Named; | ||
|
||
|
||
@Controller("/led") | ||
public class LEDController { | ||
private final LEDHelper ledHelper; | ||
|
||
|
||
public LEDController(@Named("Led")DigitalOutput led){ | ||
this.ledHelper = new LEDHelper(led); | ||
} | ||
|
||
@Get("/LEDOn") | ||
public void checkLed(){ | ||
/*deviceOff method turns on the LED after checking the output. This | ||
will turn on the LED | ||
*/ | ||
|
||
ledHelper.deviceOff(); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,8 +1,63 @@ | ||
|
||
==== LED | ||
|
||
[.text-right] | ||
https://github.com/oss-slu/Pi4Micronaut/edit/develop/micronautpi4j-utils/src/docs/asciidoc/components/outputComponents/led.adoc[Improve this doc] | ||
|
||
===== Overview | ||
This section provides details of the LED, including its components and assembly instructions. | ||
|
||
===== Components | ||
* 1 x RaspberryPi | ||
* 1 x Breadboard | ||
* 1 x T-Extension Board | ||
* 1 x LED | ||
* 2 x Jumper wires | ||
* 1 x Resistor (220Ω) | ||
* Power source (appropriate voltage, typically 3.3V) | ||
|
||
===== Assembly | ||
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. Break down the following paragraph into points using bullets |
||
|
||
* Place a single LED onto the Breadboard. | ||
* The LED will have two pins, a cathode and an anode. | ||
* Connect the cathode (short pin) of the LED to GPIO 17. | ||
* Connect the anode (long pin) to a 220Ω resistor on the positive side of the Breadboard. | ||
* Connect the other end of the resistor to 3.3V | ||
* Connect a jumper wire from GPIO 17 to the cathode of the LED. | ||
* Connect another jumper wire from 3.3V to the positive side of the Breadboard. | ||
* Two jumper wires should be connected to separate positions on the Breadboard and T-Extension Board. | ||
|
||
|
||
===== Circuit Diagram | ||
|
||
image::../../img/LED_circuit.png[] | ||
|
||
===== Testing | ||
|
||
Use: `curl http://localhost:8080/LED/LEDOn` to test the component. This will cause the LED to light. | ||
|
||
===== Troubleshooting | ||
- LED not lighting: Check the connections, and ensure the LED is placed correctly. Double-check the power source. | ||
- LED is too dim: Resistor value may be too high. Verify you're using 220Ω or adjust according to the power source your using | ||
as well as the LED specifications. | ||
|
||
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. We have two LED YML configurations led and led2. please add it here |
||
===== YAML | ||
[source, yaml] | ||
---- | ||
led: # <1> | ||
name: LED Output # <2> | ||
address: 17 # <3> | ||
shutdown: HIGH # <4> | ||
initial: HIGH # <5> | ||
provider: pigpio-digital-output # <6> | ||
|
||
led2: | ||
name: LED Output | ||
address: 26 | ||
shutdown: HIGH | ||
initial: HIGH | ||
provider: pigpio-digital-output | ||
---- | ||
|
||
===== Constructors | ||
|
||
[source, java] | ||
|
@@ -19,6 +74,7 @@ include::../../../../../../micronautpi4j-utils/src/main/java/com/opensourcewiths | |
|
||
===== An Example Controller | ||
|
||
====== This controller turns the LED on and off | ||
|
||
TODO: Create an example LED Controller | ||
[source, java] | ||
---- | ||
include:: ../../../../../../components/src/main/java/com/opensourcewithslu/components/controllers/LEDController.java[tags=method] | ||
---- |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
Have this match what is in the @get