mirror of
https://github.com/taigrr/arduinolibs
synced 2025-01-18 04:33:12 -08:00
337 lines
28 KiB
HTML
337 lines
28 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.6"/>
|
|
<title>ArduinoLibs: IRreceiver 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="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">ArduinoLibs
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.6 -->
|
|
<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><a href="pages.html"><span>Related Pages</span></a></li>
|
|
<li><a href="modules.html"><span>Modules</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="hierarchy.html"><span>Class Hierarchy</span></a></li>
|
|
<li><a href="functions.html"><span>Class Members</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<!-- 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>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Pages</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><!-- top -->
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#pub-methods">Public Member Functions</a> |
|
|
<a href="#pub-static-attribs">Static Public Attributes</a> |
|
|
<a href="#friends">Friends</a> |
|
|
<a href="classIRreceiver-members.html">List of all members</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">IRreceiver Class Reference</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>Manages the reception of RC-5 commands from an infrared remote control.
|
|
<a href="classIRreceiver.html#details">More...</a></p>
|
|
|
|
<p><code>#include <<a class="el" href="IRreceiver_8h_source.html">IRreceiver.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:a06eccb8b8311eac395e4b20c4e0163e3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a06eccb8b8311eac395e4b20c4e0163e3"></a>
|
|
 </td><td class="memItemRight" valign="bottom"><a class="el" href="classIRreceiver.html#a06eccb8b8311eac395e4b20c4e0163e3">IRreceiver</a> (int interruptNumber=0)</td></tr>
|
|
<tr class="memdesc:a06eccb8b8311eac395e4b20c4e0163e3"><td class="mdescLeft"> </td><td class="mdescRight">Constructs a new infrared remote control receiver that is attached to <em>interruptNumber</em>. <br/></td></tr>
|
|
<tr class="separator:a06eccb8b8311eac395e4b20c4e0163e3"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a4b021592a2b089dc2f1e138a38506fda"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classIRreceiver.html#a4b021592a2b089dc2f1e138a38506fda">command</a> ()</td></tr>
|
|
<tr class="memdesc:a4b021592a2b089dc2f1e138a38506fda"><td class="mdescLeft"> </td><td class="mdescRight">Returns the next command from the remote control. <a href="#a4b021592a2b089dc2f1e138a38506fda">More...</a><br/></td></tr>
|
|
<tr class="separator:a4b021592a2b089dc2f1e138a38506fda"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a19e9334ae97812fa85078507d105478f"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classIRreceiver.html#a19e9334ae97812fa85078507d105478f">system</a> () const </td></tr>
|
|
<tr class="memdesc:a19e9334ae97812fa85078507d105478f"><td class="mdescLeft"> </td><td class="mdescRight">Returns the system number of the previous <a class="el" href="classIRreceiver.html#a4b021592a2b089dc2f1e138a38506fda" title="Returns the next command from the remote control. ">command()</a>, indicating whether the command was for a TV, VCR, CD player, etc. <a href="#a19e9334ae97812fa85078507d105478f">More...</a><br/></td></tr>
|
|
<tr class="separator:a19e9334ae97812fa85078507d105478f"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a2c6adc404f71f263ba535ec1ed9cff1a"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classIRreceiver.html#a2c6adc404f71f263ba535ec1ed9cff1a">systemFilter</a> () const </td></tr>
|
|
<tr class="memdesc:a2c6adc404f71f263ba535ec1ed9cff1a"><td class="mdescLeft"> </td><td class="mdescRight">Returns the system to filter commands against, or -1 if no filter is set. <a href="#a2c6adc404f71f263ba535ec1ed9cff1a">More...</a><br/></td></tr>
|
|
<tr class="separator:a2c6adc404f71f263ba535ec1ed9cff1a"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a920828f1411fa12d1856cd933066bd08"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classIRreceiver.html#a920828f1411fa12d1856cd933066bd08">setSystemFilter</a> (int <a class="el" href="classIRreceiver.html#a19e9334ae97812fa85078507d105478f">system</a>)</td></tr>
|
|
<tr class="memdesc:a920828f1411fa12d1856cd933066bd08"><td class="mdescLeft"> </td><td class="mdescRight">Sets the <em>system</em> to filter commands against, or -1 to turn off the system filter. <a href="#a920828f1411fa12d1856cd933066bd08">More...</a><br/></td></tr>
|
|
<tr class="separator:a920828f1411fa12d1856cd933066bd08"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
|
|
Static Public Attributes</h2></td></tr>
|
|
<tr class="memitem:a9c37631cc1291dc47cabcfef2f631cf9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9c37631cc1291dc47cabcfef2f631cf9"></a>
|
|
static const int </td><td class="memItemRight" valign="bottom"><a class="el" href="classIRreceiver.html#a9c37631cc1291dc47cabcfef2f631cf9">AUTO_REPEAT</a> = 128</td></tr>
|
|
<tr class="memdesc:a9c37631cc1291dc47cabcfef2f631cf9"><td class="mdescLeft"> </td><td class="mdescRight">Flag that is added to the output of <a class="el" href="classIRreceiver.html#a4b021592a2b089dc2f1e138a38506fda" title="Returns the next command from the remote control. ">command()</a> when the command is an auto-repeated button press rather than the original button press. <br/></td></tr>
|
|
<tr class="separator:a9c37631cc1291dc47cabcfef2f631cf9"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
|
|
Friends</h2></td></tr>
|
|
<tr class="memitem:a00f78881401135b8c2a89ebf6fbc86dc"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a00f78881401135b8c2a89ebf6fbc86dc"></a>
|
|
void </td><td class="memItemRight" valign="bottom"><b>_IR_receive_interrupt</b> (void)</td></tr>
|
|
<tr class="separator:a00f78881401135b8c2a89ebf6fbc86dc"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><p>Manages the reception of RC-5 commands from an infrared remote control. </p>
|
|
<p><a class="el" href="classIRreceiver.html" title="Manages the reception of RC-5 commands from an infrared remote control. ">IRreceiver</a> recognizes commands in the <a href="http://en.wikipedia.org/wiki/RC-5">Philips RC-5 protocol</a>. This is a fairly common infrared protocol, supported by most universal remote controls. Program the universal remote to simulate a Philips TV, VCR, CD player, etc.</p>
|
|
<p>This class uses interrupts to process incoming bits from a standard 3-pin infrared receiver:</p>
|
|
<div class="image">
|
|
<img src="irchip.jpg" alt="irchip.jpg"/>
|
|
</div>
|
|
<p>Typically, pin 1 of the receiver should be connected to the Arduino interrupt pin (e.g. D2), pin 2 should be connected to GND, and pin 3 should be connected to 5V. Consult the datasheet for your receiver to be sure though; some receivers may have different pin assignments.</p>
|
|
<p>The receiver is initialized by constructing an instance of the <a class="el" href="classIRreceiver.html" title="Manages the reception of RC-5 commands from an infrared remote control. ">IRreceiver</a> class:</p>
|
|
<div class="fragment"><div class="line"><a class="code" href="classIRreceiver.html">IRreceiver</a> ir;</div>
|
|
</div><!-- fragment --><p>By default, interrupt 0 on pin D2 is used. To change to another interrupt, pass its number to the constructor:</p>
|
|
<div class="fragment"><div class="line"><a class="code" href="classIRreceiver.html">IRreceiver</a> ir(1); <span class="comment">// Interrupt 1 on pin D3</span></div>
|
|
</div><!-- fragment --><p>Currently this class can only handle a single instance of <a class="el" href="classIRreceiver.html" title="Manages the reception of RC-5 commands from an infrared remote control. ">IRreceiver</a> being active in the application. It isn't possible to have separate <a class="el" href="classIRreceiver.html" title="Manages the reception of RC-5 commands from an infrared remote control. ">IRreceiver</a> instances on different pins. Usually this won't be a problem because the same receiver can process inputs from multiple remotes.</p>
|
|
<p>The application retrieves incoming infrared commands by calling the <a class="el" href="classIRreceiver.html#a4b021592a2b089dc2f1e138a38506fda" title="Returns the next command from the remote control. ">command()</a> function. The return value indicates the type of command:</p>
|
|
<div class="fragment"><div class="line"><span class="keywordtype">void</span> loop() {</div>
|
|
<div class="line"> <span class="keywordflow">switch</span> (ir.<a class="code" href="classIRreceiver.html#a4b021592a2b089dc2f1e138a38506fda">command</a>()) {</div>
|
|
<div class="line"> <span class="keywordflow">case</span> RC5_0: <span class="keywordflow">case</span> RC5_1: <span class="keywordflow">case</span> RC5_2: <span class="keywordflow">case</span> RC5_3: <span class="keywordflow">case</span> RC5_4:</div>
|
|
<div class="line"> <span class="keywordflow">case</span> RC5_5: <span class="keywordflow">case</span> RC5_6: <span class="keywordflow">case</span> RC5_7: <span class="keywordflow">case</span> RC5_8: <span class="keywordflow">case</span> RC5_9:</div>
|
|
<div class="line"> <span class="comment">// Process a digit</span></div>
|
|
<div class="line"> ...</div>
|
|
<div class="line"> <span class="keywordflow">break</span>;</div>
|
|
<div class="line"></div>
|
|
<div class="line"> <span class="keywordflow">case</span> RC5_ERASE:</div>
|
|
<div class="line"> <span class="comment">// Backspace/erase last digit.</span></div>
|
|
<div class="line"> ...</div>
|
|
<div class="line"> <span class="keywordflow">break</span>;</div>
|
|
<div class="line"></div>
|
|
<div class="line"> <span class="keywordflow">case</span> RC5_STANDBY:</div>
|
|
<div class="line"> <span class="comment">// Power on/off button.</span></div>
|
|
<div class="line"> ...</div>
|
|
<div class="line"> <span class="keywordflow">break</span>;</div>
|
|
<div class="line"> }</div>
|
|
<div class="line">}</div>
|
|
</div><!-- fragment --><p>If the command is an auto-repeat of a previous button press, then the <a class="el" href="classIRreceiver.html#a9c37631cc1291dc47cabcfef2f631cf9">AUTO_REPEAT</a> flag will be set in the value returned from <a class="el" href="classIRreceiver.html#a4b021592a2b089dc2f1e138a38506fda" title="Returns the next command from the remote control. ">command()</a>. The application can choose to ignore all auto-repeats, process all auto-repeats, or choose which button to auto-repeat based on its code:</p>
|
|
<div class="fragment"><div class="line"><span class="keywordtype">void</span> loop() {</div>
|
|
<div class="line"> <span class="keywordflow">switch</span> (ir.<a class="code" href="classIRreceiver.html#a4b021592a2b089dc2f1e138a38506fda">command</a>()) {</div>
|
|
<div class="line"> <span class="keywordflow">case</span> RC5_INC_VOLUME:</div>
|
|
<div class="line"> <span class="keywordflow">case</span> IRreceiver::AUTO_REPEAT | RC5_INC_VOLUME:</div>
|
|
<div class="line"> <span class="comment">// Volume increase button pressed or held.</span></div>
|
|
<div class="line"> ...</div>
|
|
<div class="line"> <span class="keywordflow">break</span>;</div>
|
|
<div class="line"></div>
|
|
<div class="line"> <span class="keywordflow">case</span> RC5_DEC_VOLUME:</div>
|
|
<div class="line"> <span class="keywordflow">case</span> IRreceiver::AUTO_REPEAT | RC5_DEC_VOLUME:</div>
|
|
<div class="line"> <span class="comment">// Volume decrease button pressed or held.</span></div>
|
|
<div class="line"> ...</div>
|
|
<div class="line"> <span class="keywordflow">break</span>;</div>
|
|
<div class="line"></div>
|
|
<div class="line"> <span class="keywordflow">case</span> RC5_MUTE:</div>
|
|
<div class="line"> <span class="comment">// Mute button (ignore auto-repeat).</span></div>
|
|
<div class="line"> ...</div>
|
|
<div class="line"> <span class="keywordflow">break</span>;</div>
|
|
<div class="line"> }</div>
|
|
<div class="line">}</div>
|
|
</div><!-- fragment --><p>By default, command codes will be generated for every type of RC-5 remote control, be it a TV, VCR, CD player, or something else. The application can distinguish between the remote controls using <a class="el" href="classIRreceiver.html#a19e9334ae97812fa85078507d105478f" title="Returns the system number of the previous command(), indicating whether the command was for a TV...">system()</a>; noting that <a class="el" href="classIRreceiver.html#a4b021592a2b089dc2f1e138a38506fda" title="Returns the next command from the remote control. ">command()</a> must be called before <a class="el" href="classIRreceiver.html#a19e9334ae97812fa85078507d105478f" title="Returns the system number of the previous command(), indicating whether the command was for a TV...">system()</a> for the system value to be valid. For example, the following code could be used in a two-player video game where the first player's remote is configured as a TV and the second player's remote is configured as a VCR:</p>
|
|
<div class="fragment"><div class="line"><span class="keywordtype">void</span> loop() {</div>
|
|
<div class="line"> <span class="keywordtype">int</span> cmd = ir.<a class="code" href="classIRreceiver.html#a4b021592a2b089dc2f1e138a38506fda">command</a>();</div>
|
|
<div class="line"> <span class="keywordtype">int</span> sys = ir.<a class="code" href="classIRreceiver.html#a19e9334ae97812fa85078507d105478f">system</a>();</div>
|
|
<div class="line"> <span class="keywordflow">if</span> (sys == RC5_SYS_TV)</div>
|
|
<div class="line"> player1(cmd);</div>
|
|
<div class="line"> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (sys == RC5_SYS_VCR)</div>
|
|
<div class="line"> player2(cmd);</div>
|
|
<div class="line"></div>
|
|
<div class="line"> ...</div>
|
|
<div class="line">}</div>
|
|
</div><!-- fragment --><p>If the application only cares about a single system and wishes to ignore all other systems, it can configure a system filter at startup:</p>
|
|
<div class="fragment"><div class="line"><a class="code" href="classIRreceiver.html">IRreceiver</a> ir;</div>
|
|
<div class="line"></div>
|
|
<div class="line"><span class="keywordtype">void</span> setup() {</div>
|
|
<div class="line"> ir.<a class="code" href="classIRreceiver.html#a920828f1411fa12d1856cd933066bd08">setSystemFilter</a>(RC5_SYS_VCR);</div>
|
|
<div class="line">}</div>
|
|
</div><!-- fragment --><p>The complete list of RC-5 system numbers and command codes is given in the <a class="el" href="RC5_8h_source.html">RC5.h</a> header file.</p>
|
|
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="ir_dumpir.html">DumpIR Example</a> </dd></dl>
|
|
|
|
<p>Definition at line <a class="el" href="IRreceiver_8h_source.html#l00029">29</a> of file <a class="el" href="IRreceiver_8h_source.html">IRreceiver.h</a>.</p>
|
|
</div><h2 class="groupheader">Member Function Documentation</h2>
|
|
<a class="anchor" id="a4b021592a2b089dc2f1e138a38506fda"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int IRreceiver::command </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Returns the next command from the remote control. </p>
|
|
<p>Returns -1 if there is no new command, or the number between 0 and 127 corresponding to the command. If the command is an auto-repeat button press rather than an original button press, then the <a class="el" href="classIRreceiver.html#a9c37631cc1291dc47cabcfef2f631cf9">AUTO_REPEAT</a> flag will be set.</p>
|
|
<p>The companion function <a class="el" href="classIRreceiver.html#a19e9334ae97812fa85078507d105478f" title="Returns the system number of the previous command(), indicating whether the command was for a TV...">system()</a> will return the system number for the command indicating whether the command is for a TV, VCR, CD player, etc. By default, all systems are reported; use <a class="el" href="classIRreceiver.html#a920828f1411fa12d1856cd933066bd08" title="Sets the system to filter commands against, or -1 to turn off the system filter. ">setSystemFilter()</a> to filter out commands from all but a specific system.</p>
|
|
<p>The next call to <a class="el" href="classIRreceiver.html#a4b021592a2b089dc2f1e138a38506fda" title="Returns the next command from the remote control. ">command()</a> will return -1 or the code for the next button press.</p>
|
|
<p>The header file <code><a class="el" href="RC5_8h_source.html">RC5.h</a></code> contains a list of command codes for common remote controls.</p>
|
|
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classIRreceiver.html#a19e9334ae97812fa85078507d105478f" title="Returns the system number of the previous command(), indicating whether the command was for a TV...">system()</a>, <a class="el" href="classIRreceiver.html#a920828f1411fa12d1856cd933066bd08" title="Sets the system to filter commands against, or -1 to turn off the system filter. ">setSystemFilter()</a> </dd></dl>
|
|
|
|
<p>Definition at line <a class="el" href="IRreceiver_8cpp_source.html#l00220">220</a> of file <a class="el" href="IRreceiver_8cpp_source.html">IRreceiver.cpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a920828f1411fa12d1856cd933066bd08"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void IRreceiver::setSystemFilter </td>
|
|
<td>(</td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"><em>system</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Sets the <em>system</em> to filter commands against, or -1 to turn off the system filter. </p>
|
|
<p>If <em>system</em> is -1, then all received systems are returned via <a class="el" href="classIRreceiver.html#a4b021592a2b089dc2f1e138a38506fda" title="Returns the next command from the remote control. ">command()</a> and <a class="el" href="classIRreceiver.html#a19e9334ae97812fa85078507d105478f" title="Returns the system number of the previous command(), indicating whether the command was for a TV...">system()</a> irrespective of whether they are for a TV, VCR, CD player, or some other type of system. If <em>system</em> is set to anything other than -1, then only commands for that system are returned via <a class="el" href="classIRreceiver.html#a4b021592a2b089dc2f1e138a38506fda" title="Returns the next command from the remote control. ">command()</a>. For example:</p>
|
|
<div class="fragment"><div class="line"><a class="code" href="classIRreceiver.html">IRreceiver</a> ir;</div>
|
|
<div class="line">ir.<a class="code" href="classIRreceiver.html#a920828f1411fa12d1856cd933066bd08">setSystemFilter</a>(RC5_SYS_VCR);</div>
|
|
</div><!-- fragment --><dl class="section see"><dt>See Also</dt><dd><a class="el" href="classIRreceiver.html#a2c6adc404f71f263ba535ec1ed9cff1a" title="Returns the system to filter commands against, or -1 if no filter is set. ">systemFilter()</a>, <a class="el" href="classIRreceiver.html#a19e9334ae97812fa85078507d105478f" title="Returns the system number of the previous command(), indicating whether the command was for a TV...">system()</a>, <a class="el" href="classIRreceiver.html#a4b021592a2b089dc2f1e138a38506fda" title="Returns the next command from the remote control. ">command()</a> </dd></dl>
|
|
|
|
<p>Definition at line <a class="el" href="IRreceiver_8h_source.html#l00040">40</a> of file <a class="el" href="IRreceiver_8h_source.html">IRreceiver.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a19e9334ae97812fa85078507d105478f"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int IRreceiver::system </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Returns the system number of the previous <a class="el" href="classIRreceiver.html#a4b021592a2b089dc2f1e138a38506fda" title="Returns the next command from the remote control. ">command()</a>, indicating whether the command was for a TV, VCR, CD player, etc. </p>
|
|
<p>The return value from this function is valid only after a call to <a class="el" href="classIRreceiver.html#a4b021592a2b089dc2f1e138a38506fda" title="Returns the next command from the remote control. ">command()</a>. The next call to <a class="el" href="classIRreceiver.html#a4b021592a2b089dc2f1e138a38506fda" title="Returns the next command from the remote control. ">command()</a> will clear the system value, possibly to -1 if there is no new command.</p>
|
|
<p>The header file <code><a class="el" href="RC5_8h_source.html">RC5.h</a></code> contains a list of system numbers for common remote controls.</p>
|
|
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classIRreceiver.html#a4b021592a2b089dc2f1e138a38506fda" title="Returns the next command from the remote control. ">command()</a>, <a class="el" href="classIRreceiver.html#a920828f1411fa12d1856cd933066bd08" title="Sets the system to filter commands against, or -1 to turn off the system filter. ">setSystemFilter()</a> </dd></dl>
|
|
|
|
<p>Definition at line <a class="el" href="IRreceiver_8h_source.html#l00037">37</a> of file <a class="el" href="IRreceiver_8h_source.html">IRreceiver.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a2c6adc404f71f263ba535ec1ed9cff1a"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int IRreceiver::systemFilter </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Returns the system to filter commands against, or -1 if no filter is set. </p>
|
|
<p>If this value is -1, then all received systems are returned via <a class="el" href="classIRreceiver.html#a4b021592a2b089dc2f1e138a38506fda" title="Returns the next command from the remote control. ">command()</a> and <a class="el" href="classIRreceiver.html#a19e9334ae97812fa85078507d105478f" title="Returns the system number of the previous command(), indicating whether the command was for a TV...">system()</a> irrespective of whether they are for a TV, VCR, CD player, or some other type of system. If this value is set to anything other than -1, then only commands for that system are returned via <a class="el" href="classIRreceiver.html#a4b021592a2b089dc2f1e138a38506fda" title="Returns the next command from the remote control. ">command()</a>.</p>
|
|
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classIRreceiver.html#a920828f1411fa12d1856cd933066bd08" title="Sets the system to filter commands against, or -1 to turn off the system filter. ">setSystemFilter()</a>, <a class="el" href="classIRreceiver.html#a19e9334ae97812fa85078507d105478f" title="Returns the system number of the previous command(), indicating whether the command was for a TV...">system()</a>, <a class="el" href="classIRreceiver.html#a4b021592a2b089dc2f1e138a38506fda" title="Returns the next command from the remote control. ">command()</a> </dd></dl>
|
|
|
|
<p>Definition at line <a class="el" href="IRreceiver_8h_source.html#l00039">39</a> of file <a class="el" href="IRreceiver_8h_source.html">IRreceiver.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/>The documentation for this class was generated from the following files:<ul>
|
|
<li><a class="el" href="IRreceiver_8h_source.html">IRreceiver.h</a></li>
|
|
<li><a class="el" href="IRreceiver_8cpp_source.html">IRreceiver.cpp</a></li>
|
|
</ul>
|
|
</div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated on Sat Mar 14 2015 15:47:30 for ArduinoLibs by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.6
|
|
</small></address>
|
|
</body>
|
|
</html>
|