library/Doku/Doxygen/html/d1/d8a/group__lowerleveldrivesmeths.html

497 lines
32 KiB
HTML
Raw Normal View History

<!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('d1/d8a/group__lowerleveldrivesmeths.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="../../d6/d98/group__lowerleveldrives.html">Lower level drives methods 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:ga5812df751da5b480240ccd633c515b83"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d8a/group__lowerleveldrivesmeths.html#ga5812df751da5b480240ccd633c515b83">CodeRacer::drives_settings</a> (uint8_t drive_left_speed, uint8_t drive_right_speed, unsigned long turn_left_ms, unsigned long turn_right_ms)</td></tr>
<tr class="memdesc:ga5812df751da5b480240ccd633c515b83"><td class="mdescLeft">&#160;</td><td class="mdescRight">Overwrites some drive settings. This will replace the defaults set by the values in the header file. <a href="#ga5812df751da5b480240ccd633c515b83">More...</a><br /></td></tr>
<tr class="separator:ga5812df751da5b480240ccd633c515b83"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga61ed9e0415a62a290cc5c59a0f740304"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d8a/group__lowerleveldrivesmeths.html#ga61ed9e0415a62a290cc5c59a0f740304">CodeRacer::set_drives_stop_left_right</a> ()</td></tr>
<tr class="memdesc:ga61ed9e0415a62a290cc5c59a0f740304"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stopps both drives. <a href="#ga61ed9e0415a62a290cc5c59a0f740304">More...</a><br /></td></tr>
<tr class="separator:ga61ed9e0415a62a290cc5c59a0f740304"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga802d2646d9cc0d766e1ac799c7917fa8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d8a/group__lowerleveldrivesmeths.html#ga802d2646d9cc0d766e1ac799c7917fa8">CodeRacer::set_drives_states_left_right</a> (drivestate stateleft, drivestate stateright)</td></tr>
<tr class="memdesc:ga802d2646d9cc0d766e1ac799c7917fa8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets both of the drives to a specified drivestate (DRIVESTOP, DRIVEFRWD, DRIVEBACK) <a href="#ga802d2646d9cc0d766e1ac799c7917fa8">More...</a><br /></td></tr>
<tr class="separator:ga802d2646d9cc0d766e1ac799c7917fa8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1eeb3cb47503c3011562f9c42828fab9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d8a/group__lowerleveldrivesmeths.html#ga1eeb3cb47503c3011562f9c42828fab9">CodeRacer::set_drive_left_state</a> (drivestate state)</td></tr>
<tr class="memdesc:ga1eeb3cb47503c3011562f9c42828fab9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the left side drive to the specified drivestate (DRIVESTOP, DRIVEFRWD, DRIVEBACK) <a href="#ga1eeb3cb47503c3011562f9c42828fab9">More...</a><br /></td></tr>
<tr class="separator:ga1eeb3cb47503c3011562f9c42828fab9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1b34ec9cee1f21cd15db310167a2faa5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d8a/group__lowerleveldrivesmeths.html#ga1b34ec9cee1f21cd15db310167a2faa5">CodeRacer::set_drive_right_state</a> (drivestate state)</td></tr>
<tr class="memdesc:ga1b34ec9cee1f21cd15db310167a2faa5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the right side drive to the specified drivestate (DRIVESTOP, DRIVEFRWD, DRIVEBACK) <a href="#ga1b34ec9cee1f21cd15db310167a2faa5">More...</a><br /></td></tr>
<tr class="separator:ga1b34ec9cee1f21cd15db310167a2faa5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3b69cf4a718c842fbe758d3f4267214e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d8a/group__lowerleveldrivesmeths.html#ga3b69cf4a718c842fbe758d3f4267214e">CodeRacer::set_drive_state</a> (drivestate state, uint8_t frwdpin, uint8_t backpin)</td></tr>
<tr class="memdesc:ga3b69cf4a718c842fbe758d3f4267214e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the specified drivestate for the drive connected to the sepecified pins (DRIVESTOP, DRIVEFRWD, DRIVEBACK) <a href="#ga3b69cf4a718c842fbe758d3f4267214e">More...</a><br /></td></tr>
<tr class="separator:ga3b69cf4a718c842fbe758d3f4267214e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3d3ffb41783d34589e33cf61fed46c70"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d8a/group__lowerleveldrivesmeths.html#ga3d3ffb41783d34589e33cf61fed46c70">CodeRacer::set_drives_speed_left_right</a> (uint8_t speedleft, uint8_t speedright)</td></tr>
<tr class="memdesc:ga3d3ffb41783d34589e33cf61fed46c70"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the speed for both of the drives. <a href="#ga3d3ffb41783d34589e33cf61fed46c70">More...</a><br /></td></tr>
<tr class="separator:ga3d3ffb41783d34589e33cf61fed46c70"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1ee3da20ec98a821ab97ced070974861"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d8a/group__lowerleveldrivesmeths.html#ga1ee3da20ec98a821ab97ced070974861">CodeRacer::set_drive_left_speed</a> (uint8_t speed)</td></tr>
<tr class="memdesc:ga1ee3da20ec98a821ab97ced070974861"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the speed for the left side drive. <a href="#ga1ee3da20ec98a821ab97ced070974861">More...</a><br /></td></tr>
<tr class="separator:ga1ee3da20ec98a821ab97ced070974861"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf8805d0d620a2fb78c576f36a2c81073"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d8a/group__lowerleveldrivesmeths.html#gaf8805d0d620a2fb78c576f36a2c81073">CodeRacer::set_drive_right_speed</a> (uint8_t speed)</td></tr>
<tr class="memdesc:gaf8805d0d620a2fb78c576f36a2c81073"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the speed for the right side drive. <a href="#gaf8805d0d620a2fb78c576f36a2c81073">More...</a><br /></td></tr>
<tr class="separator:gaf8805d0d620a2fb78c576f36a2c81073"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5d67c84606d5b39996a99fcd6e7eb314"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d8a/group__lowerleveldrivesmeths.html#ga5d67c84606d5b39996a99fcd6e7eb314">CodeRacer::set_drive_speed</a> (uint8_t speed, uint8_t enablepin)</td></tr>
<tr class="memdesc:ga5d67c84606d5b39996a99fcd6e7eb314"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the speed for the drive of the enable pin connected to the specified pin. <a href="#ga5d67c84606d5b39996a99fcd6e7eb314">More...</a><br /></td></tr>
<tr class="separator:ga5d67c84606d5b39996a99fcd6e7eb314"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga5812df751da5b480240ccd633c515b83"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5812df751da5b480240ccd633c515b83">&#9670;&nbsp;</a></span>drives_settings()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CodeRacer::drives_settings </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>drive_left_speed</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>drive_right_speed</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned long&#160;</td>
<td class="paramname"><em>turn_left_for_ms</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned long&#160;</td>
<td class="paramname"><em>turn_right_for_ms</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Overwrites some drive settings. This will replace the defaults set by the values in the header file. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">drive_left_speed</td><td>Speed of the left side drive </td></tr>
<tr><td class="paramname">drive_right_speed</td><td>Speed of the right side drive </td></tr>
<tr><td class="paramname">turn_left_for_ms</td><td>Time in ms the racer will turn to the left around its center if turn_left() is called </td></tr>
<tr><td class="paramname">turn_right_for_ms</td><td>Time in ms the racer will turn to the right around its center if turn_right() is called </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#l00878">878</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="l00879"></a><span class="lineno"> 879</span>&#160;{</div><div class="line"><a name="l00880"></a><span class="lineno"> 880</span>&#160; _drive_left_speed = drive_left_speed;</div><div class="line"><a name="l00881"></a><span class="lineno"> 881</span>&#160; _drive_right_speed = drive_right_speed;</div><div class="line"><a name="l00882"></a><span class="lineno"> 882</span>&#160; _turn_left_for_ms = turn_left_for_ms;</div><div class="line"><a name="l00883"></a><span class="lineno"> 883</span>&#160; _turn_right_for_ms = turn_right_for_ms;</div><div class="line"><a name="l00884"></a><span class="lineno"> 884</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<a id="ga61ed9e0415a62a290cc5c59a0f740304"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga61ed9e0415a62a290cc5c59a0f740304">&#9670;&nbsp;</a></span>set_drives_stop_left_right()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CodeRacer::set_drives_stop_left_right </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Stopps both drives. </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#l00889">889</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="l00889"></a><span class="lineno"> 889</span>&#160; {</div><div class="line"><a name="l00890"></a><span class="lineno"> 890</span>&#160; set_drive_left_state(DRIVESTOP);</div><div class="line"><a name="l00891"></a><span class="lineno"> 891</span>&#160; set_drive_right_state(DRIVESTOP);</div><div class="line"><a name="l00892"></a><span class="lineno"> 892</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<a id="ga802d2646d9cc0d766e1ac799c7917fa8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga802d2646d9cc0d766e1ac799c7917fa8">&#9670;&nbsp;</a></span>set_drives_states_left_right()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CodeRacer::set_drives_states_left_right </td>
<td>(</td>
<td class="paramtype">drivestate&#160;</td>
<td class="paramname"><em>stateleft</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">drivestate&#160;</td>
<td class="paramname"><em>stateright</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets both of the drives to a specified drivestate (DRIVESTOP, DRIVEFRWD, DRIVEBACK) </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">stateleft</td><td>drivestate to set for the left side drive </td></tr>
<tr><td class="paramname">stateright</td><td>drivestate to set 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#l00899">899</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="l00899"></a><span class="lineno"> 899</span>&#160; {</div><div class="line"><a name="l00900"></a><span class="lineno"> 900</span>&#160; set_drive_left_state(stateleft);</div><div class="line"><a name="l00901"></a><span class="lineno"> 901</span>&#160; set_drive_right_state(stateright);</div><div class="line"><a name="l00902"></a><span class="lineno"> 902</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<a id="ga1eeb3cb47503c3011562f9c42828fab9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1eeb3cb47503c3011562f9c42828fab9">&#9670;&nbsp;</a></span>set_drive_left_state()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CodeRacer::set_drive_left_state </td>
<td>(</td>
<td class="paramtype">drivestate&#160;</td>
<td class="paramname"><em>state</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the left side drive to the specified drivestate (DRIVESTOP, DRIVEFRWD, DRIVEBACK) </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">state</td><td>drivestate to set for the left 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#l00908">908</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="l00908"></a><span class="lineno"> 908</span>&#160; {</div><div class="line"><a name="l00909"></a><span class="lineno"> 909</span>&#160; set_drive_state(state, _drive_left_frwd_pin, _drive_left_back_pin);</div><div class="line"><a name="l00910"></a><span class="lineno"> 910</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<a id="ga1b34ec9cee1f21cd15db310167a2faa5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1b34ec9cee1f21cd15db310167a2faa5">&#9670;&nbsp;</a></span>set_drive_right_state()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CodeRacer::set_drive_right_state </td>
<td>(</td>
<td class="paramtype">drivestate&#160;</td>
<td class="paramname"><em>state</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the right side drive to the specified drivestate (DRIVESTOP, DRIVEFRWD, DRIVEBACK) </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">state</td><td>drivestate to set 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#l00916">916</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="l00916"></a><span class="lineno"> 916</span>&#160; {</div><div class="line"><a name="l00917"></a><span class="lineno"> 917</span>&#160; set_drive_state(state, _drive_right_frwd_pin, _drive_right_back_pin);</div><div class="line"><a name="l00918"></a><span class="lineno"> 918</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<a id="ga3b69cf4a718c842fbe758d3f4267214e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3b69cf4a718c842fbe758d3f4267214e">&#9670;&nbsp;</a></span>set_drive_state()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CodeRacer::set_drive_state </td>
<td>(</td>
<td class="paramtype">drivestate&#160;</td>
<td class="paramname"><em>state</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>frwdpin</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>backpin</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the specified drivestate for the drive connected to the sepecified pins (DRIVESTOP, DRIVEFRWD, DRIVEBACK) </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">state</td><td>drivestate to set for the connected drive </td></tr>
<tr><td class="paramname">frwdpin</td><td>Pin the forward signal of the drive device driver is connected at </td></tr>
<tr><td class="paramname">backpin</td><td>Pin the backward signal of the drive device driver is connected at </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#l00926">926</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="l00926"></a><span class="lineno"> 926</span>&#160; {</div><div class="line"><a name="l00927"></a><span class="lineno"> 927</span>&#160; <span class="keywordflow">switch</span> (state) {</div><div class="line"><a name="l00928"></a><span class="lineno"> 928</span>&#160; <span class="keywordflow">case</span> DRIVESTOP:</div><div class="line"><a name="l00929"></a><span class="lineno"> 929</span>&#160; digitalWrite(frwdpin, LOW);</div><div class="line"><a name="l00930"></a><span class="lineno"> 930</span>&#160; digitalWrite(backpin, LOW);</div><div class="line"><a name="l00931"></a><span class="lineno"> 931</span>&#160; <span class="keywordflow">break</span>;</div><div class="line"><a name="l00932"></a><span class="lineno"> 932</span>&#160; <span class="keywordflow">case</span> DRIVEFRWD:</div><div class="line"><a name="l00933"></a><span class="lineno"> 933</span>&#160; digitalWrite(frwdpin, HIGH);</div><div class="line"><a name="l00934"></a><span class="lineno"> 934</span>&#160; digitalWrite(backpin, LOW);</div><div class="line"><a name="l00935"></a><span class="lineno"> 935</span>&#160; <span class="keywordflow">break</span>;</div><div class="line"><a name="l00936"></a><span class="lineno"> 936</span>&#160; <span class="keywordflow">case</span> DRIVEBACK:</div><div class="line"><a name="l00937"></a><span class="lineno"> 937</span>&#160; digitalWrite(frwdpin, LOW);</div><div class="line"><a name="l00938"></a><span class="lineno"> 938</span>&#160; digitalWrite(backpin, HIGH);</div><div class="line"><a name="l00939"></a><span class="lineno"> 939</span>&#160; <span class="keywordflow">break</span>;</div><div class="line"><a name="l00940"></a><span class="lineno"> 940</span>&#160; }</div><div class="line"><a name="l00941"></a><span class="lineno"> 941</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<a id="ga3d3ffb41783d34589e33cf61fed46c70"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3d3ffb41783d34589e33cf61fed46c70">&#9670;&nbsp;</a></span>set_drives_speed_left_right()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CodeRacer::set_drives_speed_left_right </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>speedleft</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>speedright</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the speed for both of the drives. </p>
<p>The drive will run with that speed afterwards. The direction of the drive has to be specfied with one of the set_drive_state methods before </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">speedleft</td><td>speed of the left side drive. 0&lt;=speed&lt;=255 </td></tr>
<tr><td class="paramname">speedright</td><td>speed of the right side drive. 0&lt;=speed&lt;=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#l00950">950</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="l00950"></a><span class="lineno"> 950</span>&#160; {</div><div class="line"><a name="l00951"></a><span class="lineno"> 951</span>&#160; set_drive_left_speed(speedleft);</div><div class="line"><a name="l00952"></a><span class="lineno"> 952</span>&#160; set_drive_right_speed(speedright);</div><div class="line"><a name="l00953"></a><span class="lineno"> 953</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<a id="ga1ee3da20ec98a821ab97ced070974861"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1ee3da20ec98a821ab97ced070974861">&#9670;&nbsp;</a></span>set_drive_left_speed()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CodeRacer::set_drive_left_speed </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>speed</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the speed for the left side drive. </p>
<p>The drive will run with that speed afterwards. The direction of the drive has to be specfied with one of the set_drive_state methods before </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">speed</td><td>speed of the left side drive. 0&lt;=speed&lt;=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#l00961">961</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="l00961"></a><span class="lineno"> 961</span>&#160; {</div><div class="line"><a name="l00962"></a><span class="lineno"> 962</span>&#160; set_drive_speed(speed, _drive_left_enable_pin);</div><div class="line"><a name="l00963"></a><span class="lineno"> 963</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<a id="gaf8805d0d620a2fb78c576f36a2c81073"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf8805d0d620a2fb78c576f36a2c81073">&#9670;&nbsp;</a></span>set_drive_right_speed()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CodeRacer::set_drive_right_speed </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>speed</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the speed for the right side drive. </p>
<p>The drive will run with that speed afterwards. The direction of the drive has to be specfied with one of the set_drive_state methods before </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">speed</td><td>speed of the right side drive. 0&lt;=speed&lt;=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#l00971">971</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="l00971"></a><span class="lineno"> 971</span>&#160; {</div><div class="line"><a name="l00972"></a><span class="lineno"> 972</span>&#160; set_drive_speed(speed, _drive_right_enable_pin);</div><div class="line"><a name="l00973"></a><span class="lineno"> 973</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<a id="ga5d67c84606d5b39996a99fcd6e7eb314"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5d67c84606d5b39996a99fcd6e7eb314">&#9670;&nbsp;</a></span>set_drive_speed()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CodeRacer::set_drive_speed </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>speed</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>enablepin</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the speed for the drive of the enable pin connected to the specified pin. </p>
<p>The drive will run with that speed afterwards. The direction of the drive has to be specfied with one of the set_drive_state methods before </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">speed</td><td>speed of the drive. 0&lt;=speed&lt;=255 </td></tr>
<tr><td class="paramname">enablepin</td><td>Pin the drives device driver enable pin is connected at </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#l00982">982</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="l00982"></a><span class="lineno"> 982</span>&#160; {</div><div class="line"><a name="l00983"></a><span class="lineno"> 983</span>&#160; _analog_write(enablepin, (<span class="keywordtype">int</span>)speed);</div><div class="line"><a name="l00984"></a><span class="lineno"> 984</span>&#160;}</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>
2018-11-13 11:15:10 +01:00
<li class="footer">Generated on Tue Nov 13 2018 11:13:48 for Arduino {code}racer API 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>