595 lines
47 KiB
HTML
595 lines
47 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.8.13"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>Arduino {code}racer API: Methods</title>
|
|
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="../../jquery.js"></script>
|
|
<script type="text/javascript" src="../../dynsections.js"></script>
|
|
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="../../resize.js"></script>
|
|
<script type="text/javascript" src="../../navtreedata.js"></script>
|
|
<script type="text/javascript" src="../../navtree.js"></script>
|
|
<script type="text/javascript">
|
|
$(document).ready(initResizable);
|
|
</script>
|
|
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="../../search/searchdata.js"></script>
|
|
<script type="text/javascript" src="../../search/search.js"></script>
|
|
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectlogo"><img alt="Logo" src="../../coderace_logo.JPG"/></td>
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">Arduino {code}racer API
|
|
</div>
|
|
<div id="projectbrief">... better know the details.</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.13 -->
|
|
<script type="text/javascript">
|
|
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
|
|
</script>
|
|
<script type="text/javascript" src="../../menudata.js"></script>
|
|
<script type="text/javascript" src="../../menu.js"></script>
|
|
<script type="text/javascript">
|
|
$(function() {
|
|
initMenu('../../',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
</script>
|
|
<div id="main-nav"></div>
|
|
</div><!-- top -->
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
<div id="nav-sync" class="sync"></div>
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
$(document).ready(function(){initNavTree('d2/d40/group__higherlevelmeths.html','../../');});
|
|
</script>
|
|
<div id="doc-content">
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#func-members">Functions</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">Methods<div class="ingroups"><a class="el" href="../../d9/d80/group__higherlevel.html">Higher level methods, setters and getters</a></div></div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
|
|
Functions</h2></td></tr>
|
|
<tr class="memitem:ga71df7ac5e41ae776a6c786d3dc36f35a"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d40/group__higherlevelmeths.html#ga71df7ac5e41ae776a6c786d3dc36f35a">CodeRacer::stop_driving</a> ()</td></tr>
|
|
<tr class="memdesc:ga71df7ac5e41ae776a6c786d3dc36f35a"><td class="mdescLeft"> </td><td class="mdescRight">Stops the racer and sets status LEDs. <a href="#ga71df7ac5e41ae776a6c786d3dc36f35a">More...</a><br /></td></tr>
|
|
<tr class="separator:ga71df7ac5e41ae776a6c786d3dc36f35a"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga8be6a850099812153dcf5768d7fc8b8c"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d40/group__higherlevelmeths.html#ga8be6a850099812153dcf5768d7fc8b8c">CodeRacer::drive_forward</a> ()</td></tr>
|
|
<tr class="memdesc:ga8be6a850099812153dcf5768d7fc8b8c"><td class="mdescLeft"> </td><td class="mdescRight">Sets the speed and the directions of both drives so that it will move forward. <a href="#ga8be6a850099812153dcf5768d7fc8b8c">More...</a><br /></td></tr>
|
|
<tr class="separator:ga8be6a850099812153dcf5768d7fc8b8c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gaae6fc379ec43cbe2cb2f63fbd12dbe0d"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d40/group__higherlevelmeths.html#gaae6fc379ec43cbe2cb2f63fbd12dbe0d">CodeRacer::drive_forward</a> (uint8_t left_speed, uint8_t right_speed)</td></tr>
|
|
<tr class="memdesc:gaae6fc379ec43cbe2cb2f63fbd12dbe0d"><td class="mdescLeft"> </td><td class="mdescRight">Sets the speed as specified for both drives and the directions of both drives so that it will move forward. <a href="#gaae6fc379ec43cbe2cb2f63fbd12dbe0d">More...</a><br /></td></tr>
|
|
<tr class="separator:gaae6fc379ec43cbe2cb2f63fbd12dbe0d"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga98aa8a5a46f769d59e6c1067c8418cfb"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d40/group__higherlevelmeths.html#ga98aa8a5a46f769d59e6c1067c8418cfb">CodeRacer::drive_backward</a> ()</td></tr>
|
|
<tr class="memdesc:ga98aa8a5a46f769d59e6c1067c8418cfb"><td class="mdescLeft"> </td><td class="mdescRight">Sets the speed and the directions of both drives so that it will move backward. <a href="#ga98aa8a5a46f769d59e6c1067c8418cfb">More...</a><br /></td></tr>
|
|
<tr class="separator:ga98aa8a5a46f769d59e6c1067c8418cfb"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga6cd8356ac76360b014db6170276b6b30"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d40/group__higherlevelmeths.html#ga6cd8356ac76360b014db6170276b6b30">CodeRacer::drive_backward</a> (uint8_t left_speed, uint8_t right_speed)</td></tr>
|
|
<tr class="memdesc:ga6cd8356ac76360b014db6170276b6b30"><td class="mdescLeft"> </td><td class="mdescRight">Sets the speed as specified for both drives and the directions of both drives so that it will move backward. <a href="#ga6cd8356ac76360b014db6170276b6b30">More...</a><br /></td></tr>
|
|
<tr class="separator:ga6cd8356ac76360b014db6170276b6b30"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga86b7caf6ff46e9d1ad90ed507864b175"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d40/group__higherlevelmeths.html#ga86b7caf6ff46e9d1ad90ed507864b175">CodeRacer::turn_left</a> ()</td></tr>
|
|
<tr class="memdesc:ga86b7caf6ff46e9d1ad90ed507864b175"><td class="mdescLeft"> </td><td class="mdescRight">Will turn the racer to the left for the internally stroe time in ms and with the internally stored speed. <a href="#ga86b7caf6ff46e9d1ad90ed507864b175">More...</a><br /></td></tr>
|
|
<tr class="separator:ga86b7caf6ff46e9d1ad90ed507864b175"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga30e1ec3fbbc206f93ea66dbf91b5fd95"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d40/group__higherlevelmeths.html#ga30e1ec3fbbc206f93ea66dbf91b5fd95">CodeRacer::turn_left</a> (unsigned long turn_for_ms)</td></tr>
|
|
<tr class="memdesc:ga30e1ec3fbbc206f93ea66dbf91b5fd95"><td class="mdescLeft"> </td><td class="mdescRight">Will turn the racer to the left for the specified time in ms and with the internally stored speed. <a href="#ga30e1ec3fbbc206f93ea66dbf91b5fd95">More...</a><br /></td></tr>
|
|
<tr class="separator:ga30e1ec3fbbc206f93ea66dbf91b5fd95"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gae6daa587199e5bf95b1aac675de53b0e"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d40/group__higherlevelmeths.html#gae6daa587199e5bf95b1aac675de53b0e">CodeRacer::turn_left</a> (unsigned long turn_for_ms, uint8_t left_speed, uint8_t right_speed)</td></tr>
|
|
<tr class="memdesc:gae6daa587199e5bf95b1aac675de53b0e"><td class="mdescLeft"> </td><td class="mdescRight">Will turn the racer to the left for the specified time in ms and with the specified speed. <a href="#gae6daa587199e5bf95b1aac675de53b0e">More...</a><br /></td></tr>
|
|
<tr class="separator:gae6daa587199e5bf95b1aac675de53b0e"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga8969fb2d6e2b5ac44a99197931e6b8da"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d40/group__higherlevelmeths.html#ga8969fb2d6e2b5ac44a99197931e6b8da">CodeRacer::turn_right</a> ()</td></tr>
|
|
<tr class="memdesc:ga8969fb2d6e2b5ac44a99197931e6b8da"><td class="mdescLeft"> </td><td class="mdescRight">Will turn the racer to the right for the internally stroe time in ms and with the internally stored speed. <a href="#ga8969fb2d6e2b5ac44a99197931e6b8da">More...</a><br /></td></tr>
|
|
<tr class="separator:ga8969fb2d6e2b5ac44a99197931e6b8da"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gae1f175aad98d773b0206f483ae0bb4ea"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d40/group__higherlevelmeths.html#gae1f175aad98d773b0206f483ae0bb4ea">CodeRacer::turn_right</a> (unsigned long turn_for_ms)</td></tr>
|
|
<tr class="memdesc:gae1f175aad98d773b0206f483ae0bb4ea"><td class="mdescLeft"> </td><td class="mdescRight">Will turn the racer to the right for the specified time in ms and with the internally stored speed. <a href="#gae1f175aad98d773b0206f483ae0bb4ea">More...</a><br /></td></tr>
|
|
<tr class="separator:gae1f175aad98d773b0206f483ae0bb4ea"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gad10b3457489cc7e25ffb4d64c539528a"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d40/group__higherlevelmeths.html#gad10b3457489cc7e25ffb4d64c539528a">CodeRacer::turn_right</a> (unsigned long turn_for_ms, uint8_t left_speed, uint8_t right_speed)</td></tr>
|
|
<tr class="memdesc:gad10b3457489cc7e25ffb4d64c539528a"><td class="mdescLeft"> </td><td class="mdescRight">Will turn the racer to the right for the specified time in ms and with the specified speed. <a href="#gad10b3457489cc7e25ffb4d64c539528a">More...</a><br /></td></tr>
|
|
<tr class="separator:gad10b3457489cc7e25ffb4d64c539528a"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga128683caea019a89bce06f722ba92556"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d40/group__higherlevelmeths.html#ga128683caea019a89bce06f722ba92556">CodeRacer::start_stop_at_min_distance</a> ()</td></tr>
|
|
<tr class="memdesc:ga128683caea019a89bce06f722ba92556"><td class="mdescLeft"> </td><td class="mdescRight">Enables to stopp the racer if during a distance measurement the measured distance is smaller then the internally stored minimal distance. <a href="#ga128683caea019a89bce06f722ba92556">More...</a><br /></td></tr>
|
|
<tr class="separator:ga128683caea019a89bce06f722ba92556"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga64bc1b2a8ed5bc3ec5e706fa70a1385d"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d40/group__higherlevelmeths.html#ga64bc1b2a8ed5bc3ec5e706fa70a1385d">CodeRacer::start_stop_at_min_distance</a> (unsigned long min_distance_cm)</td></tr>
|
|
<tr class="memdesc:ga64bc1b2a8ed5bc3ec5e706fa70a1385d"><td class="mdescLeft"> </td><td class="mdescRight">Enables to stopp the racer if during a distance measurement the measured distance is smaller then the specified minimal distance. <a href="#ga64bc1b2a8ed5bc3ec5e706fa70a1385d">More...</a><br /></td></tr>
|
|
<tr class="separator:ga64bc1b2a8ed5bc3ec5e706fa70a1385d"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gac664109241d08b8dc52db5721f394b22"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d40/group__higherlevelmeths.html#gac664109241d08b8dc52db5721f394b22">CodeRacer::stop_stop_at_min_distance</a> ()</td></tr>
|
|
<tr class="memdesc:gac664109241d08b8dc52db5721f394b22"><td class="mdescLeft"> </td><td class="mdescRight">Disables to stopp the racer if during a distance measurement the measured distance is smaller then the specified minimal distance. <a href="#gac664109241d08b8dc52db5721f394b22">More...</a><br /></td></tr>
|
|
<tr class="separator:gac664109241d08b8dc52db5721f394b22"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga34e2fe2123e76fd844482dfef6c5a9c8"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d40/group__higherlevelmeths.html#ga34e2fe2123e76fd844482dfef6c5a9c8">CodeRacer::start_stop</a> ()</td></tr>
|
|
<tr class="memdesc:ga34e2fe2123e76fd844482dfef6c5a9c8"><td class="mdescLeft"> </td><td class="mdescRight">This will return if the codracer is in active mode or not. <a href="#ga34e2fe2123e76fd844482dfef6c5a9c8">More...</a><br /></td></tr>
|
|
<tr class="separator:ga34e2fe2123e76fd844482dfef6c5a9c8"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<h2 class="groupheader">Function Documentation</h2>
|
|
<a id="ga71df7ac5e41ae776a6c786d3dc36f35a"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ga71df7ac5e41ae776a6c786d3dc36f35a">◆ </a></span>stop_driving()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void CodeRacer::stop_driving </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Stops the racer and sets status LEDs. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>nothing </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html#l00161">161</a> of file <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html">CodeRacer.cpp</a>.</p>
|
|
<div class="fragment"><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  {</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  _servo_sweep = <span class="keyword">false</span>;</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  _drive = <span class="keyword">false</span>;</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  set_drives_stop_left_right();</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  set_leds_left_stop_frwd_right(LEDOFF, LEDON, LEDOFF, LEDOFF);</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span> }</div></div><!-- fragment -->
|
|
</div>
|
|
</div>
|
|
<a id="ga8be6a850099812153dcf5768d7fc8b8c"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ga8be6a850099812153dcf5768d7fc8b8c">◆ </a></span>drive_forward() <span class="overload">[1/2]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void CodeRacer::drive_forward </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Sets the speed and the directions of both drives so that it will move forward. </p>
|
|
<p>The speed is taken from the header file or set by one of the methods defined in the lower level drive methods section </p><dl class="section return"><dt>Returns</dt><dd>nothing </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html#l00173">173</a> of file <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html">CodeRacer.cpp</a>.</p>
|
|
<div class="fragment"><div class="line"><a name="l00174"></a><span class="lineno"> 174</span> {</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  drive_forward(_drive_left_speed, _drive_right_speed);</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span> }</div></div><!-- fragment --><div class="dynheader">
|
|
Here is the call graph for this function:</div>
|
|
<div class="dyncontent">
|
|
<div class="center"><img src="../../d2/d40/group__higherlevelmeths_ga8be6a850099812153dcf5768d7fc8b8c_cgraph.png" border="0" usemap="#d2/d40/group__higherlevelmeths_ga8be6a850099812153dcf5768d7fc8b8c_cgraph" alt=""/></div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="gaae6fc379ec43cbe2cb2f63fbd12dbe0d"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#gaae6fc379ec43cbe2cb2f63fbd12dbe0d">◆ </a></span>drive_forward() <span class="overload">[2/2]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void CodeRacer::drive_forward </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint8_t </td>
|
|
<td class="paramname"><em>left_speed</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint8_t </td>
|
|
<td class="paramname"><em>right_speed</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Sets the speed as specified for both drives and the directions of both drives so that it will move forward. </p>
|
|
<p>The specified speed values for both drives will be stored internaly so next time if you use e.g. drive_forward() exactly the here specified values will be taken. </p><dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">left_speed</td><td>speed for the left side drive. 0<=speed<=255 </td></tr>
|
|
<tr><td class="paramname">right_speed</td><td>speed for the right side drive. 0<=speed<=255 </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>nothing </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html#l00185">185</a> of file <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html">CodeRacer.cpp</a>.</p>
|
|
<div class="fragment"><div class="line"><a name="l00186"></a><span class="lineno"> 186</span> {</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  set_drives_states_left_right(DRIVEFRWD, DRIVEFRWD);</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  set_drives_speed_left_right(left_speed, right_speed);</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  set_leds_left_stop_frwd_right(LEDOFF, LEDOFF, LEDON, LEDOFF);</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  _drive = <span class="keyword">true</span>;</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  _drive_set_at_ms = millis();</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span> }</div></div><!-- fragment -->
|
|
</div>
|
|
</div>
|
|
<a id="ga98aa8a5a46f769d59e6c1067c8418cfb"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ga98aa8a5a46f769d59e6c1067c8418cfb">◆ </a></span>drive_backward() <span class="overload">[1/2]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void CodeRacer::drive_backward </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Sets the speed and the directions of both drives so that it will move backward. </p>
|
|
<p>The speed is taken from the header file or set by one of the methods defined in the lower level drive methods section </p><dl class="section return"><dt>Returns</dt><dd>nothing </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html#l00199">199</a> of file <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html">CodeRacer.cpp</a>.</p>
|
|
<div class="fragment"><div class="line"><a name="l00200"></a><span class="lineno"> 200</span> {</div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  drive_backward(_drive_left_speed, _drive_right_speed);</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span> }</div></div><!-- fragment -->
|
|
</div>
|
|
</div>
|
|
<a id="ga6cd8356ac76360b014db6170276b6b30"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ga6cd8356ac76360b014db6170276b6b30">◆ </a></span>drive_backward() <span class="overload">[2/2]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void CodeRacer::drive_backward </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint8_t </td>
|
|
<td class="paramname"><em>left_speed</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint8_t </td>
|
|
<td class="paramname"><em>right_speed</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Sets the speed as specified for both drives and the directions of both drives so that it will move backward. </p>
|
|
<p>The specified speed values for both drives will be stored internaly so next time if you use e.g. drive_backward() exactly the here specified values will be taken. </p><dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">left_speed</td><td>speed for the left side drive. 0<=speed<=255 </td></tr>
|
|
<tr><td class="paramname">right_speed</td><td>speed for the right side drive. 0<=speed<=255 </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>nothing </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html#l00211">211</a> of file <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html">CodeRacer.cpp</a>.</p>
|
|
<div class="fragment"><div class="line"><a name="l00212"></a><span class="lineno"> 212</span> {</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  set_drives_states_left_right(DRIVEBACK, DRIVEBACK);</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  set_drives_speed_left_right(left_speed, right_speed);</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  set_leds_left_stop_frwd_right(LEDOFF, LEDON, LEDON, LEDOFF);</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  _drive = <span class="keyword">true</span>;</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  _drive_set_at_ms = millis();</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span> }</div></div><!-- fragment -->
|
|
</div>
|
|
</div>
|
|
<a id="ga86b7caf6ff46e9d1ad90ed507864b175"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ga86b7caf6ff46e9d1ad90ed507864b175">◆ </a></span>turn_left() <span class="overload">[1/3]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void CodeRacer::turn_left </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Will turn the racer to the left for the internally stroe time in ms and with the internally stored speed. </p>
|
|
<p>The speed for both the left side and right side drive can be set by the methods described in the lower level drive section. The turn to left time can be set by thoose methods as well. The method is delayed until the racer has turned. </p><dl class="section return"><dt>Returns</dt><dd>nothing </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html#l00226">226</a> of file <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html">CodeRacer.cpp</a>.</p>
|
|
<div class="fragment"><div class="line"><a name="l00227"></a><span class="lineno"> 227</span> {</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  turn_left(_turn_left_for_ms, _drive_left_speed, _drive_right_speed);</div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span> }</div></div><!-- fragment -->
|
|
</div>
|
|
</div>
|
|
<a id="ga30e1ec3fbbc206f93ea66dbf91b5fd95"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ga30e1ec3fbbc206f93ea66dbf91b5fd95">◆ </a></span>turn_left() <span class="overload">[2/3]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void CodeRacer::turn_left </td>
|
|
<td>(</td>
|
|
<td class="paramtype">unsigned long </td>
|
|
<td class="paramname"><em>turn_for_ms</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Will turn the racer to the left for the specified time in ms and with the internally stored speed. </p>
|
|
<p>The specified duration of time is stored internally and will be used next time by e.g. turn_left() </p><dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">turn_for_ms</td><td>duration of time in ms to turn the racer </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>nothing </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html#l00237">237</a> of file <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html">CodeRacer.cpp</a>.</p>
|
|
<div class="fragment"><div class="line"><a name="l00238"></a><span class="lineno"> 238</span> {</div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  turn_left(turn_for_ms, _drive_left_speed, _drive_right_speed);</div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span> }</div></div><!-- fragment -->
|
|
</div>
|
|
</div>
|
|
<a id="gae6daa587199e5bf95b1aac675de53b0e"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#gae6daa587199e5bf95b1aac675de53b0e">◆ </a></span>turn_left() <span class="overload">[3/3]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void CodeRacer::turn_left </td>
|
|
<td>(</td>
|
|
<td class="paramtype">unsigned long </td>
|
|
<td class="paramname"><em>turn_for_ms</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint8_t </td>
|
|
<td class="paramname"><em>left_speed</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint8_t </td>
|
|
<td class="paramname"><em>right_speed</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Will turn the racer to the left for the specified time in ms and with the specified speed. </p>
|
|
<p>The specified duration of time and the specified speeds are stored internally and will be used next time by e.g. turn_left() </p><dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">turn_for_ms</td><td>duration of time in ms to turn the racer </td></tr>
|
|
<tr><td class="paramname">left_speed</td><td>speed for the left side drive </td></tr>
|
|
<tr><td class="paramname">right_speed</td><td>speed for the right side drive </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>nothing </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html#l00250">250</a> of file <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html">CodeRacer.cpp</a>.</p>
|
|
<div class="fragment"><div class="line"><a name="l00251"></a><span class="lineno"> 251</span> {</div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  _drive = <span class="keyword">false</span>;</div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  set_leds_left_stop_frwd_right(LEDON, LEDOFF, LEDOFF, LEDOFF); <span class="comment">// LEDs setzen</span></div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  set_drives_states_left_right(DRIVEBACK, DRIVEFRWD);</div><div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  set_drives_speed_left_right(left_speed, right_speed);</div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  <span class="comment">// wait set delay for the timed turn</span></div><div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  _turn_left_for_ms = turn_for_ms;</div><div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  delay(_turn_left_for_ms);</div><div class="line"><a name="l00259"></a><span class="lineno"> 259</span>  <span class="comment">// stop drives again</span></div><div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  set_drives_stop_left_right();</div><div class="line"><a name="l00261"></a><span class="lineno"> 261</span> }</div></div><!-- fragment -->
|
|
</div>
|
|
</div>
|
|
<a id="ga8969fb2d6e2b5ac44a99197931e6b8da"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ga8969fb2d6e2b5ac44a99197931e6b8da">◆ </a></span>turn_right() <span class="overload">[1/3]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void CodeRacer::turn_right </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Will turn the racer to the right for the internally stroe time in ms and with the internally stored speed. </p>
|
|
<p>The speed for both the left side and right side drive can be set by the methods described in the lower level drive section. The turn to right time can be set by thoose methods as well. The method is delayed until the racer has turned. </p><dl class="section return"><dt>Returns</dt><dd>nothing </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html#l00269">269</a> of file <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html">CodeRacer.cpp</a>.</p>
|
|
<div class="fragment"><div class="line"><a name="l00270"></a><span class="lineno"> 270</span> {</div><div class="line"><a name="l00271"></a><span class="lineno"> 271</span>  turn_right(_turn_right_for_ms, _drive_left_speed, _drive_right_speed);</div><div class="line"><a name="l00272"></a><span class="lineno"> 272</span> }</div></div><!-- fragment -->
|
|
</div>
|
|
</div>
|
|
<a id="gae1f175aad98d773b0206f483ae0bb4ea"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#gae1f175aad98d773b0206f483ae0bb4ea">◆ </a></span>turn_right() <span class="overload">[2/3]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void CodeRacer::turn_right </td>
|
|
<td>(</td>
|
|
<td class="paramtype">unsigned long </td>
|
|
<td class="paramname"><em>turn_for_ms</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Will turn the racer to the right for the specified time in ms and with the internally stored speed. </p>
|
|
<p>The specified duration of time is stored internally and will be used next time by e.g. turn_right() </p><dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">turn_for_ms</td><td>duration of time in ms to turn the racer </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>nothing </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html#l00280">280</a> of file <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html">CodeRacer.cpp</a>.</p>
|
|
<div class="fragment"><div class="line"><a name="l00281"></a><span class="lineno"> 281</span> {</div><div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  turn_right(turn_for_ms, _drive_left_speed, _drive_right_speed);</div><div class="line"><a name="l00283"></a><span class="lineno"> 283</span> }</div></div><!-- fragment -->
|
|
</div>
|
|
</div>
|
|
<a id="gad10b3457489cc7e25ffb4d64c539528a"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#gad10b3457489cc7e25ffb4d64c539528a">◆ </a></span>turn_right() <span class="overload">[3/3]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void CodeRacer::turn_right </td>
|
|
<td>(</td>
|
|
<td class="paramtype">unsigned long </td>
|
|
<td class="paramname"><em>turn_for_ms</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint8_t </td>
|
|
<td class="paramname"><em>left_speed</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint8_t </td>
|
|
<td class="paramname"><em>right_speed</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Will turn the racer to the right for the specified time in ms and with the specified speed. </p>
|
|
<p>The specified duration of time and the specified speeds are stored internally and will be used next time by e.g. turn_right() </p><dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">turn_for_ms</td><td>duration of time in ms to turn the racer </td></tr>
|
|
<tr><td class="paramname">left_speed</td><td>speed for the left side drive </td></tr>
|
|
<tr><td class="paramname">right_speed</td><td>speed for the right side drive </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>nothing </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html#l00293">293</a> of file <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html">CodeRacer.cpp</a>.</p>
|
|
<div class="fragment"><div class="line"><a name="l00294"></a><span class="lineno"> 294</span> {</div><div class="line"><a name="l00295"></a><span class="lineno"> 295</span>  _drive = <span class="keyword">false</span>;</div><div class="line"><a name="l00296"></a><span class="lineno"> 296</span>  set_leds_left_stop_frwd_right(LEDOFF, LEDOFF, LEDOFF, LEDON); <span class="comment">// LEDs setzen</span></div><div class="line"><a name="l00297"></a><span class="lineno"> 297</span>  set_drives_states_left_right(DRIVEFRWD, DRIVEBACK);</div><div class="line"><a name="l00298"></a><span class="lineno"> 298</span>  set_drives_speed_left_right(left_speed, right_speed);</div><div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  <span class="comment">// wait set delay for the timed turn</span></div><div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  _turn_right_for_ms = turn_for_ms;</div><div class="line"><a name="l00301"></a><span class="lineno"> 301</span>  delay(_turn_right_for_ms);</div><div class="line"><a name="l00302"></a><span class="lineno"> 302</span>  <span class="comment">// stop drives again</span></div><div class="line"><a name="l00303"></a><span class="lineno"> 303</span>  set_drives_stop_left_right();</div><div class="line"><a name="l00304"></a><span class="lineno"> 304</span> }</div></div><!-- fragment -->
|
|
</div>
|
|
</div>
|
|
<a id="ga128683caea019a89bce06f722ba92556"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ga128683caea019a89bce06f722ba92556">◆ </a></span>start_stop_at_min_distance() <span class="overload">[1/2]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void CodeRacer::start_stop_at_min_distance </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Enables to stopp the racer if during a distance measurement the measured distance is smaller then the internally stored minimal distance. </p>
|
|
<p>This allow all of the none-single shot ultra sonic measurement methods to stopp the racer in the case the measured distance is smaller than minimal distance. This is just the enablement - you have to call one of the none-single-shot ultra sonic measurement methods continously while driving and maybe sweeping the servo. If the racer was stopped can be checked with stopped_at_min_distance() - it will return true in that case. The minimal distance can be set by the ultrasonic sensor setter methods. There is an example coming with the coderacer libary that you can load and get an idea how that works. </p><dl class="section return"><dt>Returns</dt><dd>nothing </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html#l00314">314</a> of file <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html">CodeRacer.cpp</a>.</p>
|
|
<div class="fragment"><div class="line"><a name="l00314"></a><span class="lineno"> 314</span>  {</div><div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  start_stop_at_min_distance(_usonic_stop_distance_cm);</div><div class="line"><a name="l00316"></a><span class="lineno"> 316</span> }</div></div><!-- fragment -->
|
|
</div>
|
|
</div>
|
|
<a id="ga64bc1b2a8ed5bc3ec5e706fa70a1385d"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ga64bc1b2a8ed5bc3ec5e706fa70a1385d">◆ </a></span>start_stop_at_min_distance() <span class="overload">[2/2]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void CodeRacer::start_stop_at_min_distance </td>
|
|
<td>(</td>
|
|
<td class="paramtype">unsigned long </td>
|
|
<td class="paramname"><em>min_distance_cm</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Enables to stopp the racer if during a distance measurement the measured distance is smaller then the specified minimal distance. </p>
|
|
<p>This is almos the same as described for start_stop_at_min_distance(). You can specify the distance in cm here - this value will be stored internally and used by start_stop_at_min_distance() next time. </p><dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">min_distance_cm</td><td>the minimal disctance in cm </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>nothing </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html#l00324">324</a> of file <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html">CodeRacer.cpp</a>.</p>
|
|
<div class="fragment"><div class="line"><a name="l00324"></a><span class="lineno"> 324</span>  {</div><div class="line"><a name="l00325"></a><span class="lineno"> 325</span>  <span class="keywordflow">if</span> (<span class="keyword">false</span> == _coderacer_stop_at_distance_enabled) {</div><div class="line"><a name="l00326"></a><span class="lineno"> 326</span>  _coderacer_stopped_at_min_distance = <span class="keyword">false</span>;</div><div class="line"><a name="l00327"></a><span class="lineno"> 327</span>  usonic_set_stop_distance_cm(min_distance_cm);</div><div class="line"><a name="l00328"></a><span class="lineno"> 328</span>  _coderacer_stop_at_distance_enabled = <span class="keyword">true</span>;</div><div class="line"><a name="l00329"></a><span class="lineno"> 329</span>  }</div><div class="line"><a name="l00330"></a><span class="lineno"> 330</span> }</div></div><!-- fragment -->
|
|
</div>
|
|
</div>
|
|
<a id="gac664109241d08b8dc52db5721f394b22"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#gac664109241d08b8dc52db5721f394b22">◆ </a></span>stop_stop_at_min_distance()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void CodeRacer::stop_stop_at_min_distance </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Disables to stopp the racer if during a distance measurement the measured distance is smaller then the specified minimal distance. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>nothing </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html#l00335">335</a> of file <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html">CodeRacer.cpp</a>.</p>
|
|
<div class="fragment"><div class="line"><a name="l00335"></a><span class="lineno"> 335</span>  {</div><div class="line"><a name="l00336"></a><span class="lineno"> 336</span>  _coderacer_stop_at_distance_enabled = <span class="keyword">false</span>;</div><div class="line"><a name="l00337"></a><span class="lineno"> 337</span> }</div></div><!-- fragment -->
|
|
</div>
|
|
</div>
|
|
<a id="ga34e2fe2123e76fd844482dfef6c5a9c8"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ga34e2fe2123e76fd844482dfef6c5a9c8">◆ </a></span>start_stop()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool CodeRacer::start_stop </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>This will return if the codracer is in active mode or not. </p>
|
|
<p>There is a button used to toogle between active and inactive each time it is pressed This may help you to start driving and scanning the distance by pressing the button - and as well to stop the racer by pressing the button. This method will set the LEDs depending on the mode and sets the servo back to center and stopps the racer when leaving the active mode. You can leave or enter the active mode as well by setting using set_active() and set_inactive(). The button itself triggers and internall interrupt event and sets the active state - but you have to continously call that method to switch between inactive and active mode depending on the active state. If in inactive mode and fun is enabeld by just setting the coderacer_fun_enabled = true ... some fun will happen :-)</p>
|
|
<dl class="section return"><dt>Returns</dt><dd>True if the coderacer is in active mode. False if in inactive mode. </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html#l00348">348</a> of file <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html">CodeRacer.cpp</a>.</p>
|
|
<div class="fragment"><div class="line"><a name="l00348"></a><span class="lineno"> 348</span>  {</div><div class="line"><a name="l00349"></a><span class="lineno"> 349</span>  <span class="keywordflow">if</span> (_coderracer_activ != coderracer_activ) {</div><div class="line"><a name="l00350"></a><span class="lineno"> 350</span>  _coderracer_activ = coderracer_activ;</div><div class="line"><a name="l00351"></a><span class="lineno"> 351</span>  <span class="keywordflow">if</span> (<span class="keyword">true</span> == _coderracer_activ) {</div><div class="line"><a name="l00352"></a><span class="lineno"> 352</span>  set_leds_all_off();</div><div class="line"><a name="l00353"></a><span class="lineno"> 353</span>  delay(500);</div><div class="line"><a name="l00354"></a><span class="lineno"> 354</span>  }</div><div class="line"><a name="l00355"></a><span class="lineno"> 355</span>  <span class="keywordflow">else</span> {</div><div class="line"><a name="l00356"></a><span class="lineno"> 356</span>  stop_driving();</div><div class="line"><a name="l00357"></a><span class="lineno"> 357</span>  set_leds_all_on();</div><div class="line"><a name="l00358"></a><span class="lineno"> 358</span>  delay(200);</div><div class="line"><a name="l00359"></a><span class="lineno"> 359</span>  servo_set_to_center();</div><div class="line"><a name="l00360"></a><span class="lineno"> 360</span>  _servo_look_around_at_ms = millis() + random(20000, 120000);</div><div class="line"><a name="l00361"></a><span class="lineno"> 361</span>  }</div><div class="line"><a name="l00362"></a><span class="lineno"> 362</span>  }</div><div class="line"><a name="l00363"></a><span class="lineno"> 363</span> </div><div class="line"><a name="l00364"></a><span class="lineno"> 364</span>  <span class="keywordflow">if</span> ((<span class="keyword">false</span> == _coderracer_activ) && (<span class="keyword">true</span> == coderacer_fun_enabled)) {</div><div class="line"><a name="l00365"></a><span class="lineno"> 365</span>  kitt();</div><div class="line"><a name="l00366"></a><span class="lineno"> 366</span>  look_around();</div><div class="line"><a name="l00367"></a><span class="lineno"> 367</span>  }</div><div class="line"><a name="l00368"></a><span class="lineno"> 368</span>  </div><div class="line"><a name="l00369"></a><span class="lineno"> 369</span>  <span class="keywordflow">return</span>(_coderracer_activ);</div><div class="line"><a name="l00370"></a><span class="lineno"> 370</span> }</div></div><!-- fragment -->
|
|
</div>
|
|
</div>
|
|
</div><!-- contents -->
|
|
</div><!-- doc-content -->
|
|
<!-- start footer part -->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
<li class="footer">Generated by
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|