Skip to content

Commit

Permalink
added documentation for UltraSonic Sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
jyanev committed Mar 18, 2024
1 parent 60a96ca commit d70685b
Show file tree
Hide file tree
Showing 55 changed files with 9,569 additions and 10,616 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import io.micronaut.http.annotation.Get;
import jakarta.inject.Named;


//tag::ex[]
@Controller("/ultraSound")
public class UltraSonicSensorController {

Expand Down Expand Up @@ -55,3 +55,4 @@ public String disableUltrasoundSensor() {
return "Ultra Sonic Sensor Disabled";
}
}
//end::ex[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
==== Ultrasonic Sensor
[.text-right]
https://github.com/oss-slu/Pi4Micronaut/edit/develop/micronautpi4j-utils/src/docs/asciidoc/components/inputComponents/ultraSonicSensor.adoc[Improve this doc]

===== Overview
This document provides details of the Ultrasonic Sensor circuit,
including its components, assembly instructions, and functionality.

===== Components
. HC SR04
. T-Extension Board
. Breadboard
. Jumper wires
. Power source

===== Circuit Diagram
Model:

image::https://docs.sunfounder.com/projects/davinci-kit/en/latest/_images/image220.png[]



Circuit Diagram:

image::https://docs.sunfounder.com/projects/davinci-kit/en/latest/_images/image329.png[]

===== Functionality
The Ultrasonic Sensor uses sound waves to calculate the distance from itself to the surface it is pointed at.
The resulting measurement is accurate within 3mm and has a stable signal within 5m of the sensor,
gradually weakening until fully it fully disappears at 7m.

===== Troubleshooting
. Distance measurements not showing: Check all connections, ensure the sensor is placed correctly,
and check the power source.

===== YAML Pin Order
The order for declaring the Trigger Pin for the Ultrasonic Sensor is as follows:

[source, yaml]
----
digital-input:
ultra-sonic-trig:
address: 23
----
So the Trigger Pin would be connected to GPIO 23.

The order for declaring the Echo Pin for the Ultrasonic Sensor is as follows:

[source, yaml]
----
digital-output:
ultra-sonic-echo:
address: 24
----
So the Echo Pin would be connected to GPIO 24.

===== Constructors

[source, java]
----
include::../../../../../../pi4micronaut-utils/src/main/java/com/opensourcewithslu/inputDevices/UltraSonicSensorHelper.java[tag=const]
----

===== Methods

[source, java]
----
include::../../../../../../pi4micronaut-utils/src/main/java/com/opensourcewithslu/inputDevices/UltraSonicSensorHelper.java[tags=method]
----

===== An Example Controller

====== This controller uses the push button to turn an LED on and off

[source, java]
----
include::../../../../../../components/src/main/java/com/opensourcewithslu/components/controllers/UltraSonicSensorController.java[tag=ex]
----
308 changes: 149 additions & 159 deletions pi4micronaut-utils/src/docs/javadoc/allclasses-index.html

Large diffs are not rendered by default.

142 changes: 71 additions & 71 deletions pi4micronaut-utils/src/docs/javadoc/allpackages-index.html
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (21) -->
<title>All Packages (pi4micronaut-utils v1.0 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="package index">
<meta name="generator" content="javadoc/AllPackagesIndexWriter">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="script-dir/jquery-ui.min.css" title="Style">
<script type="text/javascript" src="script.js"></script>
<script type="text/javascript" src="script-dir/jquery-3.6.1.min.js"></script>
<script type="text/javascript" src="script-dir/jquery-ui.min.js"></script>
</head>
<body class="all-packages-index-page">
<script type="text/javascript">var pathtoroot = "./";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span></button>
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="index.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="index-all.html">Index</a></li>
<li><a href="help-doc.html#all-packages">Help</a></li>
</ul>
</div>
<div class="sub-nav">
<div id="navbar-sub-list"></div>
<div class="nav-list-search"><a href="search.html">SEARCH</a>
<input type="text" id="search-input" disabled placeholder="Search">
<input type="reset" id="reset-button" disabled value="reset">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<div class="header">
<h1 title="All&amp;nbsp;Packages" class="title">All&nbsp;Packages</h1>
</div>
<div class="caption"><span>Package Summary</span></div>
<div class="summary-table two-column-summary">
<div class="table-header col-first">Package</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><a href="com/opensourcewithslu/package-summary.html">com.opensourcewithslu</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="com/opensourcewithslu/inputdevices/package-summary.html">com.opensourcewithslu.inputdevices</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><a href="com/opensourcewithslu/outputdevices/package-summary.html">com.opensourcewithslu.outputdevices</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="com/opensourcewithslu/utilities/package-summary.html">com.opensourcewithslu.utilities</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><a href="com/opensourcewithslu/utilities/MultiPinConfigs/package-summary.html">com.opensourcewithslu.utilities.MultiPinConfigs</a></div>
<div class="col-last even-row-color">&nbsp;</div>
</div>
</main>
</div>
</div>
</body>
</html>
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) -->
<title>All Packages (pi4micronaut-utils v1.0 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="package index">
<meta name="generator" content="javadoc/AllPackagesIndexWriter">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="script-dir/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="script.js"></script>
<script type="text/javascript" src="script-dir/jquery-3.6.1.min.js"></script>
<script type="text/javascript" src="script-dir/jquery-ui.min.js"></script>
</head>
<body class="all-packages-index-page">
<script type="text/javascript">var pathtoroot = "./";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top">
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="index.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="index-all.html">Index</a></li>
<li><a href="help-doc.html#all-packages">Help</a></li>
</ul>
</div>
<div class="sub-nav">
<div class="nav-list-search"><label for="search-input">SEARCH:</label>
<input type="text" id="search-input" value="search" disabled="disabled">
<input type="reset" id="reset-button" value="reset" disabled="disabled">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<div class="header">
<h1 title="All&amp;nbsp;Packages" class="title">All&nbsp;Packages</h1>
</div>
<div class="caption"><span>Package Summary</span></div>
<div class="summary-table two-column-summary">
<div class="table-header col-first">Package</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><a href="com/opensourcewithslu/package-summary.html">com.opensourcewithslu</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="com/opensourcewithslu/inputdevices/package-summary.html">com.opensourcewithslu.inputdevices</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><a href="com/opensourcewithslu/outputdevices/package-summary.html">com.opensourcewithslu.outputdevices</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="com/opensourcewithslu/utilities/package-summary.html">com.opensourcewithslu.utilities</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><a href="com/opensourcewithslu/utilities/MultiPinConfigs/package-summary.html">com.opensourcewithslu.utilities.MultiPinConfigs</a></div>
<div class="col-last even-row-color">&nbsp;</div>
</div>
</main>
</div>
</div>
</body>
</html>
Loading

0 comments on commit d70685b

Please sign in to comment.