Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
<!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.5"/>
<title>RedBot: RedBotSensor Class Reference</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="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</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 style="padding-left: 0.5em;">
<div id="projectname">RedBot
</div>
<div id="projectbrief">RedBot Arduino Library for the Sparkfun RedBot</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</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('class_red_bot_sensor.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)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Variables</a></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="#pub-methods">Public Member Functions</a> |
<a href="class_red_bot_sensor-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">RedBotSensor Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><code>#include <<a class="el" href="_red_bot_8h_source.html">RedBot.h</a>></code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a2ebbbab14a59c03dde759f693c59ce26"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_red_bot_sensor.html#a2ebbbab14a59c03dde759f693c59ce26">RedBotSensor</a> (int pin)</td></tr>
<tr class="separator:a2ebbbab14a59c03dde759f693c59ce26"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abd97ded86ad9de7e28ad0295a51d5c20"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_red_bot_sensor.html#abd97ded86ad9de7e28ad0295a51d5c20">read</a> ()</td></tr>
<tr class="separator:abd97ded86ad9de7e28ad0295a51d5c20"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a585a98bb820d20917bb71dfc004cc310"><td class="memItemLeft" align="right" valign="top">boolean </td><td class="memItemRight" valign="bottom"><a class="el" href="class_red_bot_sensor.html#a585a98bb820d20917bb71dfc004cc310">check</a> ()</td></tr>
<tr class="separator:a585a98bb820d20917bb71dfc004cc310"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa3e2c32c59f8ac1f9866069602a16eba"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_red_bot_sensor.html#aa3e2c32c59f8ac1f9866069602a16eba">setBGLevel</a> ()</td></tr>
<tr class="separator:aa3e2c32c59f8ac1f9866069602a16eba"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9bbf93b3c4282562e14f605a07f47c64"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_red_bot_sensor.html#a9bbf93b3c4282562e14f605a07f47c64">setDetectLevel</a> ()</td></tr>
<tr class="separator:a9bbf93b3c4282562e14f605a07f47c64"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A class for controlling the RedBot's sensors.</p>
<p>A single object of the class <a class="el" href="class_red_bot_sensor.html">RedBotSensor</a> is needed for each sensor that you want to use on the RedBot. </p>
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a class="anchor" id="a2ebbbab14a59c03dde759f693c59ce26"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">RedBotSensor::RedBotSensor </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>pin</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create a new object of the <a class="el" href="class_red_bot_sensor.html">RedBotSensor</a> class.</p>
<p><em>pin</em> is the analog input pin that the sensor is connected to.</p>
<p>Usage Example:</p>
<p>#include <<a class="el" href="_red_bot_8h_source.html">RedBot.h</a>></p>
<p><a class="el" href="class_red_bot_sensor.html">RedBotSensor</a> sensor = <a class="el" href="class_red_bot_sensor.html">RedBotSensor</a> (A2); </p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a585a98bb820d20917bb71dfc004cc310"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">boolean RedBotSensor::check </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Determines if the current sensor reading is within the configured levels.</p>
<p>This method returns <em>true</em> if the sensor's current analog value is within the configured levels. If the sensor's current analog value is outside the configured levels, <a class="el" href="class_red_bot_sensor.html#a585a98bb820d20917bb71dfc004cc310">RedBotSensor::check()</a> returns <em>false</em>. </p>
</div>
</div>
<a class="anchor" id="abd97ded86ad9de7e28ad0295a51d5c20"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int RedBotSensor::read </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Read the analog level of the sensor.</p>
<p>This method is primarily used when you want to do your own data processing instead of relying on the library's edge detection. </p>
</div>
</div>
<a class="anchor" id="aa3e2c32c59f8ac1f9866069602a16eba"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int RedBotSensor::setBGLevel </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the background/default sensor reading level.</p>
<p>Calling this method sets the sensor's reading level that corresponds to an uninteresting sensor reading. For example, if you are trying to follow a black line on a white background, you would call RedBotSensor::setBPLevel() when the light sensor is over the white background. </p>
</div>
</div>
<a class="anchor" id="a9bbf93b3c4282562e14f605a07f47c64"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int RedBotSensor::setDetectLevel </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the forground/active sensor reading level.</p>
<p>Calling this method sets the sensor's reading level that corresponds to an interesting sensor reading. For example, if you are trying to follow a black line on a white background, you would call <a class="el" href="class_red_bot_sensor.html#a9bbf93b3c4282562e14f605a07f47c64">RedBotSensor::setDetectLevel()</a> when the light sensor is over the black background. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>Arduino/RedBot/<a class="el" href="_red_bot_8h_source.html">RedBot.h</a></li>
<li>Arduino/RedBot/RedBotSensor.cpp</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="class_red_bot_sensor.html">RedBotSensor</a></li>
<li class="footer">Generated on Fri Jan 3 2014 23:40:23 for RedBot by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.5 </li>
</ul>
</div>
</body>
</html>
b1065f773This file is pinned to the selected release. Download the original to open it in your design tool.