Update documentation

This commit is contained in:
Konstantin Lampalzer 2021-03-19 15:21:45 +01:00
parent fac9a142a9
commit dbe08c033a
No known key found for this signature in database
GPG key ID: 9A60A522835A2AD9
16 changed files with 253 additions and 641 deletions

View file

@ -3,9 +3,9 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Infrared Sensor &mdash; CompLib 0.0.2 documentation</title>
@ -16,13 +16,10 @@
<!--[if lt IE 9]>
<script src="../_static/js/html5shiv.min.js"></script>
<![endif]-->
@ -53,7 +50,7 @@
<a href="../index.html" class="icon icon-home"> CompLib
<a href="../index.html" class="icon icon-home" alt="Documentation Home"> CompLib
@ -90,7 +87,13 @@
<li class="toctree-l1"><a class="reference internal" href="Api.html">Api</a></li>
<li class="toctree-l1"><a class="reference internal" href="Battery.html">Battery</a></li>
<li class="toctree-l1"><a class="reference internal" href="Buzzer.html">Buzzer</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Infrared Sensor</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Infrared Sensor</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#examples">Examples</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#testing-analog-sensors">Testing analog sensors</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="Logging.html">Logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
<li class="toctree-l1"><a class="reference internal" href="Servo.html">Servo</a></li>
@ -135,8 +138,6 @@
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
@ -148,7 +149,7 @@
<li class="wy-breadcrumbs-aside">
<a href="../_sources/lib/IRSensor.rst.txt" rel="nofollow"> View page source</a>
@ -164,82 +165,20 @@
<div class="section" id="infrared-sensor">
<span id="lib-irsensor"></span><h1>Infrared Sensor<a class="headerlink" href="#infrared-sensor" title="Permalink to this headline"></a></h1>
<dl class="py class">
<dt id="compLib.IRSensor.IRSensor">
<em class="property">class </em><code class="sig-prename descclassname">compLib.IRSensor.</code><code class="sig-name descname">IRSensor</code><a class="headerlink" href="#compLib.IRSensor.IRSensor" title="Permalink to this definition"></a></dt>
<dd><p>Access the different IR Sensors at top / bottom of the robot</p>
<dl class="py method">
<dt id="compLib.IRSensor.IRSensor.bottom_left">
<em class="property">static </em><code class="sig-name descname">bottom_left</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; bool<a class="headerlink" href="#compLib.IRSensor.IRSensor.bottom_left" title="Permalink to this definition"></a></dt>
<dd><p>Get bottom left infrared sensor status</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>True, if sensor detects IR signals</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>bool</p>
</dd>
</dl>
</dd></dl>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
<div class="section" id="testing-analog-sensors">
<h3>Testing analog sensors<a class="headerlink" href="#testing-analog-sensors" title="Permalink to this headline"></a></h3>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">compLib</span> <span class="kn">import</span> <span class="n">IRSensor</span>
<dl class="py method">
<dt id="compLib.IRSensor.IRSensor.bottom_middle">
<em class="property">static </em><code class="sig-name descname">bottom_middle</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; bool<a class="headerlink" href="#compLib.IRSensor.IRSensor.bottom_middle" title="Permalink to this definition"></a></dt>
<dd><p>Get bottom middle infrared sensor status</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>True, if sensor detects IR signals</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>bool</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="compLib.IRSensor.IRSensor.bottom_right">
<em class="property">static </em><code class="sig-name descname">bottom_right</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; bool<a class="headerlink" href="#compLib.IRSensor.IRSensor.bottom_right" title="Permalink to this definition"></a></dt>
<dd><p>Get bottom right infrared sensor status</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>True, if sensor detects IR signals</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>bool</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="compLib.IRSensor.IRSensor.top_left_percent">
<em class="property">static </em><code class="sig-name descname">top_left_percent</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; int<a class="headerlink" href="#compLib.IRSensor.IRSensor.top_left_percent" title="Permalink to this definition"></a></dt>
<dd><p>Get top left infrared sensor percentage</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Percentage between 0 and 100</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>int</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="compLib.IRSensor.IRSensor.top_right_percent">
<em class="property">static </em><code class="sig-name descname">top_right_percent</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; int<a class="headerlink" href="#compLib.IRSensor.IRSensor.top_right_percent" title="Permalink to this definition"></a></dt>
<dd><p>Get top right infrared sensor percentage</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Percentage between 0 and 100</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>int</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<span class="n">ir</span> <span class="o">=</span> <span class="n">IRSensor</span><span class="o">.</span><span class="n">IRSensor</span><span class="p">()</span>
<span class="k">while</span> <span class="kc">True</span><span class="p">:</span>
<span class="nb">print</span> <span class="p">(</span><span class="s2">&quot;left: </span><span class="si">{}</span><span class="s2"> middle: </span><span class="si">{}</span><span class="s2"> right: </span><span class="si">{}</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">ir</span><span class="o">.</span><span class="n">bottom_left_analog</span><span class="p">(),</span> <span class="n">ir</span><span class="o">.</span><span class="n">bottom_middle_analog</span><span class="p">(),</span> <span class="n">ir</span><span class="o">.</span><span class="n">bottom_right_analog</span><span class="p">()))</span>
</pre></div>
</div>
</div>
</div>
</div>
@ -247,29 +186,37 @@
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="Logging.html" class="btn btn-neutral float-right" title="Logging" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="Buzzer.html" class="btn btn-neutral float-left" title="Buzzer" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="Logging.html" class="btn btn-neutral float-right" title="Logging" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="Buzzer.html" class="btn btn-neutral float-left" title="Buzzer" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&#169; Copyright 2021, robo4you.
&copy; Copyright 2021, robo4you
</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
<a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>