-
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.
* updating adocs * how to use pi4micronaut * how to use pi4micronaut adoc updates * adoc updates * indent fix * adoc changes addressed * adoc changes * adoc link updates * adoc indent fix * adoc fix * adoc final updates * adoc final final updates
- Loading branch information
Showing
12 changed files
with
116 additions
and
38 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
72 changes: 72 additions & 0 deletions
72
pi4micronaut-utils/src/docs/asciidoc/Introduction/howToUsePi4Micronaut.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,72 @@ | ||
:imagesdir: img/ | ||
|
||
ifndef::rootpath[] | ||
:rootpath: ../ | ||
endif::rootpath[] | ||
|
||
ifdef::rootpath[] | ||
:imagesdir: {rootpath}{imagesdir} | ||
endif::rootpath[] | ||
|
||
|
||
=== How to use the Pi4Micronaut library | ||
|
||
This section will walk you through the process of creating a basic | ||
Micronaut application and the configuration for developing | ||
with Pi4Micronaut. As a demo, this will include the configuration and sample code. | ||
|
||
==== Creating A Micronaut Project | ||
. Go to Micronaut's website https://micronaut.io/launch/[here]. | ||
. Make sure you have selected Micronaut version 3.10.1 or lower with Java version 17. | ||
. Click Generate Project and download the zip. | ||
. Export the contents of the zip file and open it in IntelliJ or any IDE of your choice. | ||
+ | ||
It should look like: | ||
image:Using_Micronaut.png[] | ||
|
||
==== Add Dependency | ||
. Go to the build.gradle file and find the dependencies. | ||
. Add the Pi4Micronaut dependency to the list. | ||
+ | ||
[source, gradle] | ||
---- | ||
implementation("io.github.oss-slu:pi4micronaut-utils:v1.0:all") | ||
---- | ||
+ | ||
It should look like: | ||
image:Adding_Dependency.png[] | ||
|
||
==== Setup Configuration | ||
. Go to the application.yml file and add the configuration of your circuit setup: | ||
+ | ||
path: Demo_Pi4Micronaut/src/main/resources/application.yml | ||
. Create a new tree in the yml file as shown below. | ||
+ | ||
[source, yaml] | ||
---- | ||
pi4j: | ||
digital-output: | ||
led: | ||
name: LED | ||
address: 17 | ||
shutdown: LOW | ||
initial: LOW | ||
provider: pigpio-digital-output | ||
---- | ||
+ | ||
Here we are specifying a led as a digital output type with name LED, address 17, etc. | ||
For more information on the LED setup guide, see our documentation https://oss-slu.github.io/Pi4Micronaut/#_led[here]. | ||
+ | ||
It should look like: | ||
image:Add_Configuration.png[] | ||
|
||
==== Creating Component Class | ||
. Create a new class in the project's src directory as shown below. | ||
+ | ||
path: Demo_Pi4Micronaut/src/main/java/com.demoPi4Micronaut | ||
+ | ||
This is where you use the implemented LED functions from Pi4Micronaut library. | ||
|
||
. Our example code is: | ||
+ | ||
image:Add_Class.png[] |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+90.7 KB
pi4micronaut-utils/src/docs/asciidoc/img/SSH_to_Pi_And_Run_Jar_File.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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