diff --git a/micronautpi4j-utils/src/docs/asciidoc/contribute/ExampleController.java b/micronautpi4j-utils/src/docs/asciidoc/contribute/ExampleController.java new file mode 100644 index 00000000..d359cf70 --- /dev/null +++ b/micronautpi4j-utils/src/docs/asciidoc/contribute/ExampleController.java @@ -0,0 +1,25 @@ +package com.opensourcewithslu.components.controllers; + +import com.opensourcewithslu.inputdevices.ExamplHelper; +import com.opensourcewithslu.outputdevices.LEDHelper; +import io.micronaut.http.annotation.Controller; +import io.micronaut.http.annotation.Get; + +//tag::ex[] +@Controller("/example") +public class ExampleController { + private final PushButtonHelper pushButtonHelper; + + + public ExampleController(ExamplHelper exampleHelper) { + this.exampleHelper = exampleHelper; + } + + @Get("/init") + public void initController(){ + exampleHelper.addEventListener(e ->{ + /*Some action */ + }); + } +} +//end::ex[] \ No newline at end of file diff --git a/micronautpi4j-utils/src/docs/asciidoc/contribute/newComponent.adoc b/micronautpi4j-utils/src/docs/asciidoc/contribute/newComponent.adoc index b4134757..e6c030ce 100644 --- a/micronautpi4j-utils/src/docs/asciidoc/contribute/newComponent.adoc +++ b/micronautpi4j-utils/src/docs/asciidoc/contribute/newComponent.adoc @@ -1,3 +1,23 @@ +=== How to Create a New Component +[.text-right] +https://github.com/oss-slu/Pi4Micronaut/edit/develop/micronautpi4j-utils/src/docs/asciidoc/contribute/newComponent.adoc[Improve this doc] +TODO: add info on how to add a new component -TODO: add info on how to add a new component \ No newline at end of file +* controller +** controls the component +** `components\src\main\java\com\opensourcewithslu\components\controllers` + +include::exampleController.java[tag=ex] + + +* helper +** where all the actions are defined. +** `micronautpi4j-utils\src\main\java\com\opensourcewithslu` + + +* input versus output device +** input devices main task is taking in information +*** `micronautpi4j-utils\src\main\java\com\opensourcewithslu\inputdevices` +** output devices display or output information +*** `micronautpi4j-utils\src\main\java\com\opensourcewithslu\outputdevices` diff --git a/micronautpi4j-utils/src/docs/asciidoc/howContribute.adoc b/micronautpi4j-utils/src/docs/asciidoc/howContribute.adoc index 4852fd9c..2e8288f2 100644 --- a/micronautpi4j-utils/src/docs/asciidoc/howContribute.adoc +++ b/micronautpi4j-utils/src/docs/asciidoc/howContribute.adoc @@ -3,3 +3,5 @@ https://github.com/oss-slu/Pi4Micronaut/edit/develop/micronautpi4j-utils/src/docs/asciidoc/howContribute.adoc[Improve this doc] TODO: outline how someone can contribute to our library + +include::contribute/newComponent.adoc[] \ No newline at end of file