diff --git a/pi4micronaut-utils/src/docs/asciidoc/components.adoc b/pi4micronaut-utils/src/docs/asciidoc/components.adoc deleted file mode 100644 index a8fab7d0..00000000 --- a/pi4micronaut-utils/src/docs/asciidoc/components.adoc +++ /dev/null @@ -1,4 +0,0 @@ -== Components -[.text-right] -https://github.com/oss-slu/Pi4Micronaut/edit/develop/pi4micronaut-utils/src/docs/asciidoc/components.adoc[Improve this doc] - diff --git a/pi4micronaut-utils/src/docs/asciidoc/components/commun_WithHardware/digitalInput.adoc b/pi4micronaut-utils/src/docs/asciidoc/components/commun_WithHardware/digitalInput.adoc index f12cf798..1f46b6f6 100644 --- a/pi4micronaut-utils/src/docs/asciidoc/components/commun_WithHardware/digitalInput.adoc +++ b/pi4micronaut-utils/src/docs/asciidoc/components/commun_WithHardware/digitalInput.adoc @@ -3,7 +3,9 @@ [.text-right] https://github.com/oss-slu/Pi4Micronaut/edit/develop/pi4micronaut-utils/src/docs/asciidoc/components/commun_WithHardware/digitalInput.adoc[Improve this doc] -To define in application.yaml add digital-input as a field under pi4j, then add each component under digital-input. +"Digital Input" refers to a type of electronic signal or data that can be read by the Raspberry Pi's GPIO pins. These signals are binary, meaning they can only be in one of two states: HIGH (1) or LOW (0). + +To define in application.yaml add digital-input as a field under Pi4J, then add each component under digital-input. Each component will need diff --git a/pi4micronaut-utils/src/docs/asciidoc/components/commun_WithHardware/digitalOutput.adoc b/pi4micronaut-utils/src/docs/asciidoc/components/commun_WithHardware/digitalOutput.adoc index 6f9f39dd..baa15cb2 100644 --- a/pi4micronaut-utils/src/docs/asciidoc/components/commun_WithHardware/digitalOutput.adoc +++ b/pi4micronaut-utils/src/docs/asciidoc/components/commun_WithHardware/digitalOutput.adoc @@ -2,7 +2,11 @@ [.text-right] https://github.com/oss-slu/Pi4Micronaut/edit/develop/pi4micronaut-utils/src/docs/asciidoc/components/commun_WithHardware/digitalOutput.adoc[Improve this doc] -To define in application.yaml add digital-output as a field under pi4j, then add each component under digital-output. +"Digital Output" refers to a signal sent from the Raspberry Pi's GPIO pins to another device or circuit. Unlike digital input, which the Raspberry Pi reads, digital output is a signal that the Raspberry Pi sends out. + +Digital outputs are also binary, meaning they can only have two states: HIGH (1) or LOW (0). These states correspond to different voltage levels, typically 3.3V for high and 0V (ground) for low on a Raspberry Pi. + +To define in application.yaml, add digital-output as a field under Pi4J, then add each component under digital-output. Each component will need diff --git a/pi4micronaut-utils/src/docs/asciidoc/components/commun_WithHardware/spi.adoc b/pi4micronaut-utils/src/docs/asciidoc/components/commun_WithHardware/spi.adoc index 83c84f3f..25cebf75 100644 --- a/pi4micronaut-utils/src/docs/asciidoc/components/commun_WithHardware/spi.adoc +++ b/pi4micronaut-utils/src/docs/asciidoc/components/commun_WithHardware/spi.adoc @@ -24,9 +24,7 @@ SPI uses 4 separate connections to communicate with the target device: ==== -*Note:* - -Controller/Peripheral is formerly referred to as Master/Slave. In order to move away from the use of such terminology, we have opted to use the term Controller in place of Master, and Peripheral in place of Slave. +*Note:* Controller/Peripheral is formerly referred to as Master/Slave. In order to move away from the use of such terminology, we have opted to use the term Controller in place of Master, and Peripheral in place of Slave. ==== diff --git a/pi4micronaut-utils/src/docs/asciidoc/components/inputComponents.adoc b/pi4micronaut-utils/src/docs/asciidoc/components/inputComponents.adoc index d5c83ddc..016b6a9c 100644 --- a/pi4micronaut-utils/src/docs/asciidoc/components/inputComponents.adoc +++ b/pi4micronaut-utils/src/docs/asciidoc/components/inputComponents.adoc @@ -1,3 +1,5 @@ === Input Components [.text-right] https://github.com/oss-slu/Pi4Micronaut/edit/develop/pi4micronaut-utils/src/docs/asciidoc/components/inputComponents.adoc[Improve this doc] + +The Components that provide input signal or data to the application from Raspberry Pi GPIO pins. \ No newline at end of file diff --git a/pi4micronaut-utils/src/docs/asciidoc/components/inputComponents/pushButton.adoc b/pi4micronaut-utils/src/docs/asciidoc/components/inputComponents/pushButton.adoc index 9e59e509..5c0ad5c4 100644 --- a/pi4micronaut-utils/src/docs/asciidoc/components/inputComponents/pushButton.adoc +++ b/pi4micronaut-utils/src/docs/asciidoc/components/inputComponents/pushButton.adoc @@ -19,9 +19,9 @@ including its components, assembly instructions, and functionality. image::https://docs.sunfounder.com/projects/raphael-kit/en/latest/_images/image152.png[] -.Note: The 220Ω resistor is for the LED and the 10Ω for the button. +.*Note:* The 220Ω resistor is for the LED and the 10Ω for the button. -Schematic Diagram: +*Schematic Diagram:* image::https://docs.sunfounder.com/projects/raphael-kit/en/latest/_images/image303.png[] diff --git a/pi4micronaut-utils/src/docs/asciidoc/components/inputComponents/rotaryEncoder.adoc b/pi4micronaut-utils/src/docs/asciidoc/components/inputComponents/rotaryEncoder.adoc index c767dda2..3b441b1d 100644 --- a/pi4micronaut-utils/src/docs/asciidoc/components/inputComponents/rotaryEncoder.adoc +++ b/pi4micronaut-utils/src/docs/asciidoc/components/inputComponents/rotaryEncoder.adoc @@ -38,10 +38,10 @@ stated below and in the diagram. ===== Circuit Diagram -- Note the resistor location at GPIO 27 - image::rotary_encoder_circuit.png[] +*Note:* The resistor location at GPIO 27. + ===== Functionality The rotary encoder returns the value as you rotate the knob. @@ -88,7 +88,7 @@ for more details. ===== An Example Controller -====== This controller sets up two rotary encoders +====== This controller uses a rotary encoder [source, java] ---- diff --git a/pi4micronaut-utils/src/docs/asciidoc/components/inputComponents/touchSwitch.adoc b/pi4micronaut-utils/src/docs/asciidoc/components/inputComponents/touchSwitch.adoc index 911de076..c24f19a1 100644 --- a/pi4micronaut-utils/src/docs/asciidoc/components/inputComponents/touchSwitch.adoc +++ b/pi4micronaut-utils/src/docs/asciidoc/components/inputComponents/touchSwitch.adoc @@ -46,7 +46,7 @@ so that power can be supplied to the LED and touch switch as shown in the diagra image:touchSwitchDiagram.png[] -Schematic Diagram: +*Schematic Diagram:* image:touchSwitch.png[] @@ -61,13 +61,13 @@ Use the below commands to test the touch switch. * `/enable` - turns on touch switch [source, bash] ---- -curl http://localhost:8080/touchSwitch/enable +$ curl http://localhost:8080/touchSwitch/enable ---- * `/disable` - turns off touch switch [source, bash] ---- -curl http://localhost:8080/touchSwitch/disable +$ curl http://localhost:8080/touchSwitch/disable ---- ===== Troubleshooting diff --git a/pi4micronaut-utils/src/docs/asciidoc/components/inputComponents/ultraSonicSensor.adoc b/pi4micronaut-utils/src/docs/asciidoc/components/inputComponents/ultraSonicSensor.adoc index 4e3b4253..7f483a68 100644 --- a/pi4micronaut-utils/src/docs/asciidoc/components/inputComponents/ultraSonicSensor.adoc +++ b/pi4micronaut-utils/src/docs/asciidoc/components/inputComponents/ultraSonicSensor.adoc @@ -28,7 +28,7 @@ including its components, assembly instructions, and functionality. image::ultrasonic_sensor_model.png[] -Schematic Diagram: +*Schematic Diagram:* image::ultrasonic_sensor_circuit.png[] diff --git a/pi4micronaut-utils/src/docs/asciidoc/components/outputComponents.adoc b/pi4micronaut-utils/src/docs/asciidoc/components/outputComponents.adoc index 69b74a22..2aa6278c 100644 --- a/pi4micronaut-utils/src/docs/asciidoc/components/outputComponents.adoc +++ b/pi4micronaut-utils/src/docs/asciidoc/components/outputComponents.adoc @@ -2,3 +2,5 @@ [.text-right] https://github.com/oss-slu/Pi4Micronaut/edit/develop/pi4micronaut-utils/src/docs/asciidoc/components/outputComponents.adoc[Improve this doc] + +The Components that provide output signal either by emitting, displaying, lighting, etc. through Raspberry Pi GPIO pins. \ No newline at end of file diff --git a/pi4micronaut-utils/src/docs/asciidoc/contribute/newComponent.adoc b/pi4micronaut-utils/src/docs/asciidoc/contribute/newComponent.adoc index 3b43df53..aae5fc50 100644 --- a/pi4micronaut-utils/src/docs/asciidoc/contribute/newComponent.adoc +++ b/pi4micronaut-utils/src/docs/asciidoc/contribute/newComponent.adoc @@ -3,35 +3,38 @@ https://github.com/oss-slu/Pi4Micronaut/edit/develop/pi4micronaut-utils/src/docs/asciidoc/contribute/newComponent.adoc[Improve this doc] -If its compatible with a Raspberry Pi then it should work well with the Pi4Micronaut framework. The following steps should encompass how most components are added to the framework, but should more or different steps be needed, create a new +If its compatible with a Raspberry Pi then it should work well with the Pi4Micronaut. The following steps should encompass how most components are added to the library. Start by creating a new https://github.com/oss-slu/Pi4Micronaut/issues/new/choose[Issue] to suggest changes. -1. Determine the communication type for that device. For example, Buzzer works with PWM and LCD1602 works with I2C. +1. Determine the communication type for the component which you want to use. For example, Buzzer works with PWM and LCD1602 works with I2C. -2. Create a Controller: -** Controllers define and handle interactions with a given component. The Controller of a component will have a `@Controller("/example")` right above the class declaration that acts as the endpoint for requests to the component. Instead of "example", you should name the endpoint something that is identifiable to the component. Each method of the Controller should have a `@Get("/exampleEndPoint")` above the method declaration. The endpoint for the method should have the same name as the method and any parameters should be included in the endpoint `/exampleEndPoint/{parameter1},{parameter2}`. -** See the https://github.com/oss-slu/Pi4Micronaut/blob/develop/components/src/main/java/com/opensourcewithslu/components/controllers/rgbController.java[RGB Controller] for an example of a Controller. -** Consult the https://micronaut-projects.github.io/micronaut-docs-mn3/3.8.1/guide/#creatingClient[Micronaut Documentation] for more explanation on Controllers. -** All Controllers should be kept here: -`components\src\main\java\com\opensourcewithslu\components\controllers` +2. Setup the circuit. + +3. Add Component to the Application yml + +** The new component will need to be added to the application yml found at `components/src/main/resources/application.yml`. +** More information on the `application.yml` found in <> -3. Create a Helper: -** A Helper is what the Controller calls to do a action. For example, to change the color of an RGB LED the controller will take the request to change it. The Controller will then call the change color method in the helper. The helper then takes all the actions needed to change the color of the LED. +4. Create a Helper: +** A Helper is what the Controller calls to do an action. For example, to change the color of an RGB LED the controller will take the request to change it. The Controller will then call the change color method in the helper. The helper then takes all the actions needed to change the color of the LED. ** See the https://github.com/oss-slu/Pi4Micronaut/blob/develop/pi4micronaut-utils/src/main/java/com/opensourcewithslu/outputdevices/RGBLEDHelper.java[RBG Helper] for an example of a Helper. ** All Helpers should be kept here: `pi4micronaut-utils\src\main\java\com\opensourcewithslu\(inputdevices or outputdevices)` -4. Add Component to the Application yml - - ** The new component will need to be added to the application yml found at `components/src/main/resources/application.yml`. - ** More information on the `application.yml` found in <> +5. Create a Controller: +** Controllers define and handle interactions with a given component. The Controller of a component will have a `@Controller("/example")` right above the class declaration that acts as the endpoint for requests to the component. Instead of "example", you should name the endpoint something that is identifiable to the component. Each method of the Controller should have a `@Get("/exampleEndPoint")` above the method declaration. The endpoint for the method should have the same name as the method and any parameters should be included in the endpoint `/exampleEndPoint/{parameter1},{parameter2}`. +** See the https://github.com/oss-slu/Pi4Micronaut/blob/develop/components/src/main/java/com/opensourcewithslu/components/controllers/rgbController.java[RGB Controller] for an example of a Controller. +** Consult the https://micronaut-projects.github.io/micronaut-docs-mn3/3.8.1/guide/#creatingClient[Micronaut Documentation] for more explanation on Controllers. +** All Controllers should be kept here: +`components\src\main\java\com\opensourcewithslu\components\controllers` -5. Thoroughly test: +6. Thoroughly test: ** Contributors should thoroughly test their integrations ** When submitting a pull request, make sure to include how you tested the component, any circuits that you may have used, and how to run any examples you may have created. ** It is important that reviewers are able to replicated your work in order to properly test the implementation. -6. Create documentation for the component: + +7. Create documentation for the component: ** Create an .adoc file with the component name as the file name. ** Make sure to include all the information that the other components. Simply copy/paste an existing components documentation and edit as needed. ** Add the file here: `pi4micronaut-utils/src/docs/asciidoc/components` under either input or output components. \ No newline at end of file diff --git a/pi4micronaut-utils/src/docs/asciidoc/index.adoc b/pi4micronaut-utils/src/docs/asciidoc/index.adoc index 5312a1b5..c9fa8ce8 100644 --- a/pi4micronaut-utils/src/docs/asciidoc/index.adoc +++ b/pi4micronaut-utils/src/docs/asciidoc/index.adoc @@ -33,8 +33,7 @@ include::contribute/contributingToLibrary.adoc[] include::contribute/newComponent.adoc[] - -include::components.adoc[] +== Components include::components/commun_WithHardware.adoc[]