336 lines
24 KiB
HTML
336 lines
24 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('db/dd5/group__lowerlevelservomeths.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="../../d3/d17/group__lowerlevelservo.html">Lower level servo drive 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:ga687beb327e20f4d0541d1ac9e29c01c3"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/dd5/group__lowerlevelservomeths.html#ga687beb327e20f4d0541d1ac9e29c01c3">CodeRacer::servo_settings</a> (uint8_t pos_center, uint8_t pos_left, uint8_t pos_right, uint8_t sweep_left_pos, uint8_t sweep_right_pos)</td></tr>
|
||
|
<tr class="memdesc:ga687beb327e20f4d0541d1ac9e29c01c3"><td class="mdescLeft"> </td><td class="mdescRight">Overwrites the default settings taken from header file by the parameters given to this method. <a href="#ga687beb327e20f4d0541d1ac9e29c01c3">More...</a><br /></td></tr>
|
||
|
<tr class="separator:ga687beb327e20f4d0541d1ac9e29c01c3"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:ga1e9afe1f27dfc9796b4c9b3dba245365"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/dd5/group__lowerlevelservomeths.html#ga1e9afe1f27dfc9796b4c9b3dba245365">CodeRacer::servo_sweep</a> ()</td></tr>
|
||
|
<tr class="memdesc:ga1e9afe1f27dfc9796b4c9b3dba245365"><td class="mdescLeft"> </td><td class="mdescRight">Turns sweeping of the servo from left to right and back on. <a href="#ga1e9afe1f27dfc9796b4c9b3dba245365">More...</a><br /></td></tr>
|
||
|
<tr class="separator:ga1e9afe1f27dfc9796b4c9b3dba245365"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:gaac73bf99cf2d19f7b1987156aa842b74"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/dd5/group__lowerlevelservomeths.html#gaac73bf99cf2d19f7b1987156aa842b74">CodeRacer::servo_set_to_right</a> ()</td></tr>
|
||
|
<tr class="memdesc:gaac73bf99cf2d19f7b1987156aa842b74"><td class="mdescLeft"> </td><td class="mdescRight">Drives the servo to the postion that is defined by #servo_right_pos. <a href="#gaac73bf99cf2d19f7b1987156aa842b74">More...</a><br /></td></tr>
|
||
|
<tr class="separator:gaac73bf99cf2d19f7b1987156aa842b74"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:gaef7d1903b65a0a8ab4fafdc53080b07d"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/dd5/group__lowerlevelservomeths.html#gaef7d1903b65a0a8ab4fafdc53080b07d">CodeRacer::servo_set_to_left</a> ()</td></tr>
|
||
|
<tr class="memdesc:gaef7d1903b65a0a8ab4fafdc53080b07d"><td class="mdescLeft"> </td><td class="mdescRight">Drives the servo to the postion that is defined by #servo_left_pos. <a href="#gaef7d1903b65a0a8ab4fafdc53080b07d">More...</a><br /></td></tr>
|
||
|
<tr class="separator:gaef7d1903b65a0a8ab4fafdc53080b07d"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:gad1f28aa91079e88fc3093e3074edfb32"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/dd5/group__lowerlevelservomeths.html#gad1f28aa91079e88fc3093e3074edfb32">CodeRacer::servo_set_to_center</a> ()</td></tr>
|
||
|
<tr class="memdesc:gad1f28aa91079e88fc3093e3074edfb32"><td class="mdescLeft"> </td><td class="mdescRight">Drives the servo to the postion that is defined by #servo_center_pos. <a href="#gad1f28aa91079e88fc3093e3074edfb32">More...</a><br /></td></tr>
|
||
|
<tr class="separator:gad1f28aa91079e88fc3093e3074edfb32"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:ga0149226288bff2290d52ed1cbd674edd"><td class="memItemLeft" align="right" valign="top">uint8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/dd5/group__lowerlevelservomeths.html#ga0149226288bff2290d52ed1cbd674edd">CodeRacer::servo_set_position_wait</a> (uint8_t position)</td></tr>
|
||
|
<tr class="memdesc:ga0149226288bff2290d52ed1cbd674edd"><td class="mdescLeft"> </td><td class="mdescRight">Drive the servo to the postion given to this method. <a href="#ga0149226288bff2290d52ed1cbd674edd">More...</a><br /></td></tr>
|
||
|
<tr class="separator:ga0149226288bff2290d52ed1cbd674edd"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:gab8831340049de6dbddeda997745725e6"><td class="memItemLeft" align="right" valign="top">unsigned long </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/dd5/group__lowerlevelservomeths.html#gab8831340049de6dbddeda997745725e6">CodeRacer::servo_set_position</a> (uint8_t position)</td></tr>
|
||
|
<tr class="memdesc:gab8831340049de6dbddeda997745725e6"><td class="mdescLeft"> </td><td class="mdescRight">Drive the servo to the postion given to this method. <a href="#gab8831340049de6dbddeda997745725e6">More...</a><br /></td></tr>
|
||
|
<tr class="separator:gab8831340049de6dbddeda997745725e6"><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="ga687beb327e20f4d0541d1ac9e29c01c3"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga687beb327e20f4d0541d1ac9e29c01c3">◆ </a></span>servo_settings()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void CodeRacer::servo_settings </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">uint8_t </td>
|
||
|
<td class="paramname"><em>pos_center</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">uint8_t </td>
|
||
|
<td class="paramname"><em>pos_left</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">uint8_t </td>
|
||
|
<td class="paramname"><em>pos_right</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">uint8_t </td>
|
||
|
<td class="paramname"><em>sweep_left_pos</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">uint8_t </td>
|
||
|
<td class="paramname"><em>sweep_right_pos</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Overwrites the default settings taken from header file by the parameters given to this method. </p>
|
||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">pos_center</td><td>The postion at which the servo moves to straight forward. Default is 90. Allowed 10 <= pos_center <= 170. </td></tr>
|
||
|
<tr><td class="paramname">pos_left</td><td>The postion at which the servo moves to the left. Default is 170. Allowed 10 <= pos_center <= 170. </td></tr>
|
||
|
<tr><td class="paramname">pos_right</td><td>The postion at which the servo moves to the right. Default is 10. Allowed 10 <= pos_center <= 170. </td></tr>
|
||
|
<tr><td class="paramname">sweep_left_pos</td><td>If the servo is sweeping from left to the right - this defines the most left postion. Default is 140. Allowed 10 <= pos_center <= 170. </td></tr>
|
||
|
<tr><td class="paramname">sweep_right_pos</td><td>If the servo is sweeping from left to the right - this defines the most right postion. Default is 40. Allowed 10 <= pos_center <= 170. </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#l00510">510</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="l00511"></a><span class="lineno"> 511</span> {</div><div class="line"><a name="l00512"></a><span class="lineno"> 512</span>  servo_center_pos = pos_center;</div><div class="line"><a name="l00513"></a><span class="lineno"> 513</span>  servo_left_pos = pos_left;</div><div class="line"><a name="l00514"></a><span class="lineno"> 514</span>  servo_right_pos = pos_right;</div><div class="line"><a name="l00515"></a><span class="lineno"> 515</span>  servo_sweep_left_pos = sweep_left_pos;</div><div class="line"><a name="l00516"></a><span class="lineno"> 516</span>  servo_sweep_right_pos = sweep_right_pos;</div><div class="line"><a name="l00517"></a><span class="lineno"> 517</span> }</div></div><!-- fragment -->
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="ga1e9afe1f27dfc9796b4c9b3dba245365"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga1e9afe1f27dfc9796b4c9b3dba245365">◆ </a></span>servo_sweep()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void CodeRacer::servo_sweep </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Turns sweeping of the servo from left to right and back on. </p>
|
||
|
<p>The sweeping range is defind by #servo_sweep_left_pos and #servo_sweep_right_pos attributes. Both can be set by either servo_settings() or as public members. Every time servo_sweep() is called the servo is driven by 5 steps until either #servo_sweep_left_pos or #servo_sweep_right_pos is reached. Then it will turn the direction and step to the other side every time this method is called. </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#l00526">526</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="l00527"></a><span class="lineno"> 527</span> {</div><div class="line"><a name="l00528"></a><span class="lineno"> 528</span>  uint8_t position;</div><div class="line"><a name="l00529"></a><span class="lineno"> 529</span>  _servo_sweep = <span class="keyword">true</span>;</div><div class="line"><a name="l00530"></a><span class="lineno"> 530</span>  <span class="keywordflow">if</span> (millis() - _servo_position_set_at_ms > SERVO_SWEEP_MS) {</div><div class="line"><a name="l00531"></a><span class="lineno"> 531</span>  position = _servo_position + _servo_sweep_step;</div><div class="line"><a name="l00532"></a><span class="lineno"> 532</span>  <span class="comment">//sprintf(_debugmsg,"[%s] current position=%ld newpostion=%ld", __func__, _servo_position, position);</span></div><div class="line"><a name="l00533"></a><span class="lineno"> 533</span>  <span class="keywordflow">if</span> ((position >= servo_sweep_left_pos) || (position >= SERVO_MAX_POSITION)) {</div><div class="line"><a name="l00534"></a><span class="lineno"> 534</span>  position = servo_sweep_left_pos;</div><div class="line"><a name="l00535"></a><span class="lineno"> 535</span>  _servo_sweep_step = SERVO_SWEEP_TO_RIGHT_STEP;</div><div class="line"><a name="l00536"></a><span class="lineno"> 536</span>  }</div><div class="line"><a name="l00537"></a><span class="lineno"> 537</span>  <span class="keywordflow">if</span> ((position <= servo_sweep_right_pos) || (position <= SERVO_MIN_POSITION)) {</div><div class="line"><a name="l00538"></a><span class="lineno"> 538</span>  position = servo_sweep_right_pos;</div><div class="line"><a name="l00539"></a><span class="lineno"> 539</span>  _servo_sweep_step = SERVO_SWEEP_TO_LEFT_STEP;</div><div class="line"><a name="l00540"></a><span class="lineno"> 540</span>  }</div><div class="line"><a name="l00541"></a><span class="lineno"> 541</span>  _servo_set_position(position);</div><div class="line"><a name="l00542"></a><span class="lineno"> 542</span>  }</div><div class="line"><a name="l00543"></a><span class="lineno"> 543</span> }</div></div><!-- fragment -->
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="gaac73bf99cf2d19f7b1987156aa842b74"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#gaac73bf99cf2d19f7b1987156aa842b74">◆ </a></span>servo_set_to_right()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void CodeRacer::servo_set_to_right </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Drives the servo to the postion that is defined by #servo_right_pos. </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#l00548">548</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="l00549"></a><span class="lineno"> 549</span> {</div><div class="line"><a name="l00550"></a><span class="lineno"> 550</span>  servo_set_position_wait(servo_right_pos);</div><div class="line"><a name="l00551"></a><span class="lineno"> 551</span> }</div></div><!-- fragment -->
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="gaef7d1903b65a0a8ab4fafdc53080b07d"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#gaef7d1903b65a0a8ab4fafdc53080b07d">◆ </a></span>servo_set_to_left()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void CodeRacer::servo_set_to_left </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Drives the servo to the postion that is defined by #servo_left_pos. </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#l00556">556</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="l00557"></a><span class="lineno"> 557</span> {</div><div class="line"><a name="l00558"></a><span class="lineno"> 558</span>  servo_set_position_wait(servo_left_pos);</div><div class="line"><a name="l00559"></a><span class="lineno"> 559</span> }</div></div><!-- fragment -->
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="gad1f28aa91079e88fc3093e3074edfb32"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#gad1f28aa91079e88fc3093e3074edfb32">◆ </a></span>servo_set_to_center()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void CodeRacer::servo_set_to_center </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Drives the servo to the postion that is defined by #servo_center_pos. </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#l00564">564</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="l00565"></a><span class="lineno"> 565</span> {</div><div class="line"><a name="l00566"></a><span class="lineno"> 566</span>  servo_set_position_wait(servo_center_pos);</div><div class="line"><a name="l00567"></a><span class="lineno"> 567</span> }</div></div><!-- fragment -->
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="ga0149226288bff2290d52ed1cbd674edd"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga0149226288bff2290d52ed1cbd674edd">◆ </a></span>servo_set_position_wait()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">uint8_t CodeRacer::servo_set_position_wait </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">uint8_t </td>
|
||
|
<td class="paramname"><em>position</em></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Drive the servo to the postion given to this method. </p>
|
||
|
<p>The method will wait until the servo has reached its new position. </p><dl class="params"><dt>Parameters</dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">position</td><td>Position the servo will be drived to. Allowed are values 10<=postion<=170. 10 is at the right hand side, 170 at the left hand side. </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="section return"><dt>Returns</dt><dd>The new servo position </dd></dl>
|
||
|
|
||
|
<p class="definition">Definition at line <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html#l00575">575</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="l00576"></a><span class="lineno"> 576</span> {</div><div class="line"><a name="l00577"></a><span class="lineno"> 577</span>  _servo_sweep = <span class="keyword">false</span>;</div><div class="line"><a name="l00578"></a><span class="lineno"> 578</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> wait_time_ms = _servo_set_position(position);</div><div class="line"><a name="l00579"></a><span class="lineno"> 579</span>  delay(wait_time_ms);</div><div class="line"><a name="l00580"></a><span class="lineno"> 580</span>  <span class="keywordflow">return</span>(_servo_position);</div><div class="line"><a name="l00581"></a><span class="lineno"> 581</span> }</div></div><!-- fragment -->
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="gab8831340049de6dbddeda997745725e6"></a>
|
||
|
<h2 class="memtitle"><span class="permalink"><a href="#gab8831340049de6dbddeda997745725e6">◆ </a></span>servo_set_position()</h2>
|
||
|
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">unsigned long CodeRacer::servo_set_position </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">uint8_t </td>
|
||
|
<td class="paramname"><em>position</em></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
<p>Drive the servo to the postion given to this method. </p>
|
||
|
<p>The method will not wait until the servo has reached its new position. </p><dl class="params"><dt>Parameters</dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">position</td><td>Position the servo will be drived to. Allowed are values 10<=postion<=170. 10 is at the right hand side, 170 at the left hand side. </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="section return"><dt>Returns</dt><dd>The time in ms the servo will need to reach the new position </dd></dl>
|
||
|
|
||
|
<p class="definition">Definition at line <a class="el" href="../../d4/da7/_code_racer_8cpp_source.html#l00589">589</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="l00590"></a><span class="lineno"> 590</span> {</div><div class="line"><a name="l00591"></a><span class="lineno"> 591</span>  _servo_sweep = <span class="keyword">false</span>;</div><div class="line"><a name="l00592"></a><span class="lineno"> 592</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> wait_time_ms = _servo_set_position(position);</div><div class="line"><a name="l00593"></a><span class="lineno"> 593</span>  <span class="keywordflow">return</span>(wait_time_ms);</div><div class="line"><a name="l00594"></a><span class="lineno"> 594</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>
|