Update documentation
This commit is contained in:
parent
bcaeff1a1c
commit
f8433c1b23
20 changed files with 577 additions and 2440 deletions
|
@ -1,33 +1,16 @@
|
|||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html class="writer-html5" lang="de" >
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Mein zweites Programm — CompLib 0.2.3 Dokumentation</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="../_static/js/html5shiv.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
|
||||
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
|
||||
<script src="../_static/jquery.js"></script>
|
||||
<script src="../_static/underscore.js"></script>
|
||||
|
@ -35,39 +18,21 @@
|
|||
<script src="../_static/doctools.js"></script>
|
||||
<script src="../_static/sphinx_highlight.js"></script>
|
||||
<script src="../_static/translations.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script src="../_static/js/theme.js"></script>
|
||||
<link rel="index" title="Stichwortverzeichnis" href="../genindex.html" />
|
||||
<link rel="search" title="Suche" href="../search.html" />
|
||||
<link rel="next" title="Mein drittes Programm" href="thridProgram.html" />
|
||||
<link rel="prev" title="Mein erstes Programm" href="firstProgram.html" />
|
||||
</head>
|
||||
|
||||
<body class="wy-body-for-nav">
|
||||
|
||||
|
||||
<body class="wy-body-for-nav">
|
||||
<div class="wy-grid-for-nav">
|
||||
|
||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||||
<div class="wy-side-scroll">
|
||||
<div class="wy-side-nav-search" >
|
||||
|
||||
|
||||
|
||||
<a href="../index.html">
|
||||
|
||||
|
||||
|
||||
|
||||
<img src="../_static/compair-logo-white.svg" class="logo" alt="Logo"/>
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="search">
|
||||
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
|
||||
<input type="text" name="q" placeholder="Dokumentation durchsuchen" />
|
||||
|
@ -75,18 +40,7 @@
|
|||
<input type="hidden" name="area" value="default" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
|
||||
<ul class="current">
|
||||
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Erste Schritte</a><ul class="current">
|
||||
<li class="toctree-l2"><a class="reference internal" href="wifi.html">WLAN-Verbindung herstellen</a></li>
|
||||
|
@ -110,75 +64,35 @@
|
|||
<li class="toctree-l1"><a class="reference internal" href="../other/hardware.html">Hardware</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
||||
|
||||
|
||||
<nav class="wy-nav-top" aria-label="top navigation">
|
||||
|
||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="../index.html">CompLib</a>
|
||||
|
||||
</nav>
|
||||
|
||||
|
||||
<div class="wy-nav-content">
|
||||
|
||||
<div class="rst-content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<div role="navigation" aria-label="Page navigation">
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
||||
<li><a href="../index.html" class="icon icon-home"></a> »</li>
|
||||
|
||||
<li><a href="index.html">Erste Schritte</a> »</li>
|
||||
|
||||
<li>Mein zweites Programm</li>
|
||||
|
||||
|
||||
<li><a href="../index.html" class="icon icon-home"></a></li>
|
||||
<li class="breadcrumb-item"><a href="index.html">Erste Schritte</a></li>
|
||||
<li class="breadcrumb-item active">Mein zweites Programm</li>
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
|
||||
<a href="../_sources/gettingStarted/secondProgram.rst.txt" rel="nofollow"> Quelltext anzeigen</a>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<hr/>
|
||||
</div>
|
||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||||
<div itemprop="articleBody">
|
||||
|
||||
<div class="section" id="mein-zweites-programm">
|
||||
<h1>Mein zweites Programm<a class="headerlink" href="#mein-zweites-programm" title="Permalink to this heading">¶</a></h1>
|
||||
<div class="section" id="motoren-ansteuern">
|
||||
<h2>Motoren ansteuern<a class="headerlink" href="#motoren-ansteuern" title="Permalink to this heading">¶</a></h2>
|
||||
|
||||
<section id="mein-zweites-programm">
|
||||
<h1>Mein zweites Programm<a class="headerlink" href="#mein-zweites-programm" title="Permalink to this heading"></a></h1>
|
||||
<section id="motoren-ansteuern">
|
||||
<h2>Motoren ansteuern<a class="headerlink" href="#motoren-ansteuern" title="Permalink to this heading"></a></h2>
|
||||
<p>Um die Motoren des Roboters zu steuern, müssen wir zunächst das entsprechende Python-Modul am Anfang der Datei importieren. Dann können wir Motor.power(port, power) verwenden, um den Motor zu steuern.
|
||||
Dies ist auch ein guter Punkt, um sich mit der Dokumentation vertraut zu machen: Besuchen wir <a class="reference external" href="https://lib.comp-air.at/lib/Motor.html#compLib.Motor.Motor.power">https://lib.comp-air.at/lib/Motor.html#compLib.Motor.Motor.power</a>. Hier werden die beiden relevanten Parameter beschrieben.</p>
|
||||
<p>Als Beispiel wollen wir den rechten Motor für fünf Sekunden auf volle Geschwindigkeit setzen:</p>
|
||||
|
@ -190,9 +104,9 @@ Dies ist auch ein guter Punkt, um sich mit der Dokumentation vertraut zu machen:
|
|||
<span class="linenos">6</span><span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="gerade-fahren">
|
||||
<h2>Gerade fahren<a class="headerlink" href="#gerade-fahren" title="Permalink to this heading">¶</a></h2>
|
||||
</section>
|
||||
<section id="gerade-fahren">
|
||||
<h2>Gerade fahren<a class="headerlink" href="#gerade-fahren" title="Permalink to this heading"></a></h2>
|
||||
<p>Um geradeaus zu fahren, müssen wir beide Motoren auf dieselbe Geschwindigkeit einstellen.
|
||||
Aber Achtung! Der rechte Motor muss umgedreht werden! Das liegt daran, dass einer nach rechts und einer nach links zeigt, sie sind also technisch gesehen gespiegelt.
|
||||
Wenn wir nun diesen Code ausführen, wird der Roboter 5 Sekunden lang vorwärts fahren:</p>
|
||||
|
@ -214,8 +128,8 @@ Wenn wir nun diesen Code ausführen, wird der Roboter 5 Sekunden lang vorwärts
|
|||
<div class="line">In <code class="docutils literal notranslate"><span class="pre">Zeile</span> <span class="pre">7</span></code> müssen wir warten, bis der Roboter die Fahrbefehle tatsächlich ausführt. In diesem Fall warten wir <code class="docutils literal notranslate"><span class="pre">5</span></code> Sekunden lang.</div>
|
||||
</div>
|
||||
<p>Danach wird das Programm beendet und der Roboter bleibt stehen.</p>
|
||||
<div class="section" id="mehr-fahren">
|
||||
<h3>Mehr fahren<a class="headerlink" href="#mehr-fahren" title="Permalink to this heading">¶</a></h3>
|
||||
<section id="mehr-fahren">
|
||||
<h3>Mehr fahren<a class="headerlink" href="#mehr-fahren" title="Permalink to this heading"></a></h3>
|
||||
<p>Jetzt ist es Zeit für einige komplexere Bewegungen. Um unseren Code modular und leicht lesbar zu halten, werden wir jede Aktion in eine eigene Funktion packen.</p>
|
||||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="linenos">1</span><span class="kn">import</span> <span class="nn">time</span>
|
||||
<span class="linenos">2</span><span class="kn">from</span> <span class="nn">compLib.Motor</span> <span class="kn">import</span> <span class="n">Motor</span>
|
||||
|
@ -434,64 +348,39 @@ Nun werden wir uns einige weitere Optimierungen und bewährte Verfahren ansehen.
|
|||
<p>Wenn du die Fahrgeschwindigkeit auf eine sehr kleine Zahl einstellst, kann es sein, dass sich der Roboter gar nicht mehr bewegt, weil die Motoren eine bestimmte Menge an Energie benötigen, um den Roboter überhaupt zu bewegen.</p>
|
||||
<p><strong>3. Fahren Sie nicht zu schnell.</strong></p>
|
||||
<p>Wenn du die Fahrgeschwindigkeit auf eine sehr hohe Zahl einstellst (z. B. <code class="docutils literal notranslate"><span class="pre">100</span></code>), könnte dein Roboter zu schnell für seine Sensoren sein. Dies wird später wichtig sein, wenn wir versuchen, eine schwarze Linie zu erkennen, aber zu schnell über sie fahren.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
||||
|
||||
<a href="thridProgram.html" class="btn btn-neutral float-right" title="Mein drittes Programm" accesskey="n" rel="next">Weiter <span class="fa fa-arrow-circle-right"></span></a>
|
||||
|
||||
|
||||
<a href="firstProgram.html" class="btn btn-neutral float-left" title="Mein erstes Programm" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Zurück</a>
|
||||
|
||||
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
|
||||
<a href="firstProgram.html" class="btn btn-neutral float-left" title="Mein erstes Programm" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Zurück</a>
|
||||
<a href="thridProgram.html" class="btn btn-neutral float-right" title="Mein drittes Programm" accesskey="n" rel="next">Weiter <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
||||
</div>
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
|
||||
© Copyright 2022, Verein zur Förderung von Wissenschaft und Technik an Schulen (F-WuTS)
|
||||
|
||||
</p>
|
||||
<p>© Copyright 2022, Verein zur Förderung von Wissenschaft und Technik an Schulen (F-WuTS).</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Erstellt mit <a href="http://sphinx-doc.org/">Sphinx</a> mit einem
|
||||
|
||||
<a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a>
|
||||
|
||||
bereitgestellt von <a href="https://readthedocs.org">Read the Docs</a>.
|
||||
|
||||
Erstellt mit <a href="https://www.sphinx-doc.org/">Sphinx</a> mit einem
|
||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
||||
bereitgestellt von <a href="https://readthedocs.org">Read the Docs</a>.
|
||||
|
||||
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
<script>
|
||||
jQuery(function () {
|
||||
SphinxRtdTheme.Navigation.enable(true);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
Reference in a new issue