mirror of
https://github.com/taigrr/arduinolibs
synced 2025-01-18 04:33:12 -08:00
Update docs
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
<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: ChaseLEDs Class Reference</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
@@ -29,7 +30,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.8.1.2 -->
|
||||
<!-- Generated by Doxygen 1.8.6 -->
|
||||
<script type="text/javascript">
|
||||
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||
</script>
|
||||
@@ -96,39 +97,45 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||
|
||||
<p><code>#include <<a class="el" href="ChaseLEDs_8h_source.html">ChaseLEDs.h</a>></code></p>
|
||||
<table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2><a name="pub-methods"></a>
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
|
||||
Public Member Functions</h2></td></tr>
|
||||
<tr class="memitem:ab6bb3da371d3730a6552e93a9b2eab78"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classChaseLEDs.html#ab6bb3da371d3730a6552e93a9b2eab78">ChaseLEDs</a> (const uint8_t *pins, int num, unsigned long <a class="el" href="classChaseLEDs.html#aed060c51bb63dd8065be89f895989700">advanceTime</a>)</td></tr>
|
||||
<tr class="memdesc:ab6bb3da371d3730a6552e93a9b2eab78"><td class="mdescLeft"> </td><td class="mdescRight">Initializes the LED chaser. <a href="#ab6bb3da371d3730a6552e93a9b2eab78"></a><br/></td></tr>
|
||||
<tr class="memdesc:ab6bb3da371d3730a6552e93a9b2eab78"><td class="mdescLeft"> </td><td class="mdescRight">Initializes the LED chaser. <a href="#ab6bb3da371d3730a6552e93a9b2eab78">More...</a><br/></td></tr>
|
||||
<tr class="separator:ab6bb3da371d3730a6552e93a9b2eab78"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a8745fa6b9f33b6c6274a563dd4dea786"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classChaseLEDs.html#a8745fa6b9f33b6c6274a563dd4dea786">loop</a> ()</td></tr>
|
||||
<tr class="separator:a8745fa6b9f33b6c6274a563dd4dea786"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:aed060c51bb63dd8065be89f895989700"><td class="memItemLeft" align="right" valign="top">unsigned long </td><td class="memItemRight" valign="bottom"><a class="el" href="classChaseLEDs.html#aed060c51bb63dd8065be89f895989700">advanceTime</a> () const </td></tr>
|
||||
<tr class="memdesc:aed060c51bb63dd8065be89f895989700"><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of milliseconds that each LED will be lit in the chase sequence. <a href="#aed060c51bb63dd8065be89f895989700"></a><br/></td></tr>
|
||||
<tr class="memdesc:aed060c51bb63dd8065be89f895989700"><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of milliseconds that each LED will be lit in the chase sequence. <a href="#aed060c51bb63dd8065be89f895989700">More...</a><br/></td></tr>
|
||||
<tr class="separator:aed060c51bb63dd8065be89f895989700"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:af560270f72302c19fb7f95002089c9d7"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classChaseLEDs.html#af560270f72302c19fb7f95002089c9d7">setAdvanceTime</a> (unsigned long <a class="el" href="classChaseLEDs.html#aed060c51bb63dd8065be89f895989700">advanceTime</a>)</td></tr>
|
||||
<tr class="memdesc:af560270f72302c19fb7f95002089c9d7"><td class="mdescLeft"> </td><td class="mdescRight">Sets the number of milliseconds to advance between LED's to <em>advanceTime</em>. <a href="#af560270f72302c19fb7f95002089c9d7"></a><br/></td></tr>
|
||||
<tr class="memdesc:af560270f72302c19fb7f95002089c9d7"><td class="mdescLeft"> </td><td class="mdescRight">Sets the number of milliseconds to advance between LED's to <em>advanceTime</em>. <a href="#af560270f72302c19fb7f95002089c9d7">More...</a><br/></td></tr>
|
||||
<tr class="separator:af560270f72302c19fb7f95002089c9d7"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2><a name="pro-methods"></a>
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
|
||||
Protected Member Functions</h2></td></tr>
|
||||
<tr class="memitem:aa0f4e0bd07dd65ee5574e894a612486b"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classChaseLEDs.html#aa0f4e0bd07dd65ee5574e894a612486b">advance</a> (uint8_t prevPin, uint8_t nextPin)</td></tr>
|
||||
<tr class="memdesc:aa0f4e0bd07dd65ee5574e894a612486b"><td class="mdescLeft"> </td><td class="mdescRight">Advances to the next LED in sequence, turning off <em>prevPin</em>, and turning on <em>nextPin</em>. <a href="#aa0f4e0bd07dd65ee5574e894a612486b"></a><br/></td></tr>
|
||||
<tr class="memdesc:aa0f4e0bd07dd65ee5574e894a612486b"><td class="mdescLeft"> </td><td class="mdescRight">Advances to the next LED in sequence, turning off <em>prevPin</em>, and turning on <em>nextPin</em>. <a href="#aa0f4e0bd07dd65ee5574e894a612486b">More...</a><br/></td></tr>
|
||||
<tr class="separator:aa0f4e0bd07dd65ee5574e894a612486b"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a27c460fcb341c2dc2fcf9341616eb525"><td class="memItemLeft" align="right" valign="top">uint8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525">previousPin</a> (int n) const </td></tr>
|
||||
<tr class="memdesc:a27c460fcb341c2dc2fcf9341616eb525"><td class="mdescLeft"> </td><td class="mdescRight">Returns the pin that is <em>n</em> steps back in the sequence. <a href="#a27c460fcb341c2dc2fcf9341616eb525"></a><br/></td></tr>
|
||||
<tr class="memdesc:a27c460fcb341c2dc2fcf9341616eb525"><td class="mdescLeft"> </td><td class="mdescRight">Returns the pin that is <em>n</em> steps back in the sequence. <a href="#a27c460fcb341c2dc2fcf9341616eb525">More...</a><br/></td></tr>
|
||||
<tr class="separator:a27c460fcb341c2dc2fcf9341616eb525"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2>Detailed Description</h2>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p>Chase LED's on output pins in a defined sequence. </p>
|
||||
<p>The following example performs a LED chase over the 6 PWM outputs on the Arduino Uno, with a 150 millisecond delay between each LED:</p>
|
||||
<div class="fragment"><div class="line">uint8_t pins[] = {3, 5, 6, 9, 10, 11};</div>
|
||||
<div class="line"><a class="code" href="classChaseLEDs.html" title="Chase LED's on output pins in a defined sequence.">ChaseLEDs</a> chaser(pins, <span class="keyword">sizeof</span>(pins), 150);</div>
|
||||
<div class="line"><a class="code" href="classChaseLEDs.html">ChaseLEDs</a> chaser(pins, <span class="keyword">sizeof</span>(pins), 150);</div>
|
||||
<div class="line"></div>
|
||||
<div class="line"><span class="keywordtype">void</span> <a class="code" href="classChaseLEDs.html#a8745fa6b9f33b6c6274a563dd4dea786">loop</a>() {</div>
|
||||
<div class="line"> chaser.loop();</div>
|
||||
<div class="line">}</div>
|
||||
</div><!-- fragment --><p>After pin 11 is lit, the pattern will repeat at pin 3. To cause the chase to oscillate back and forth instead, extend the sequence as follows:</p>
|
||||
<div class="fragment"><div class="line">uint8_t pins[] = {3, 5, 6, 9, 10, 11, 10, 9, 6, 5};</div>
|
||||
<div class="line"><a class="code" href="classChaseLEDs.html" title="Chase LED's on output pins in a defined sequence.">ChaseLEDs</a> chaser(pins, <span class="keyword">sizeof</span>(pins), 150);</div>
|
||||
</div><!-- fragment --><p>See the <a class="el" href="blink_cylon.html">Cylon</a> example for more information on how to use the <a class="el" href="classChaseLEDs.html" title="Chase LED's on output pins in a defined sequence.">ChaseLEDs</a> class in a practical application. </p>
|
||||
<div class="line"><a class="code" href="classChaseLEDs.html">ChaseLEDs</a> chaser(pins, <span class="keyword">sizeof</span>(pins), 150);</div>
|
||||
</div><!-- fragment --><p>See the <a class="el" href="blink_cylon.html">Cylon</a> example for more information on how to use the <a class="el" href="classChaseLEDs.html" title="Chase LED's on output pins in a defined sequence. ">ChaseLEDs</a> class in a practical application. </p>
|
||||
|
||||
<p>Definition at line <a class="el" href="ChaseLEDs_8h_source.html#l00028">28</a> of file <a class="el" href="ChaseLEDs_8h_source.html">ChaseLEDs.h</a>.</p>
|
||||
</div><h2>Constructor & Destructor Documentation</h2>
|
||||
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
|
||||
<a class="anchor" id="ab6bb3da371d3730a6552e93a9b2eab78"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
@@ -168,7 +175,7 @@ Protected Member Functions</h2></td></tr>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<h2>Member Function Documentation</h2>
|
||||
<h2 class="groupheader">Member Function Documentation</h2>
|
||||
<a class="anchor" id="aa0f4e0bd07dd65ee5574e894a612486b"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
@@ -205,8 +212,8 @@ Protected Member Functions</h2></td></tr>
|
||||
<p>The default implementation is equivalent to the following code:</p>
|
||||
<div class="fragment"><div class="line">digitalWrite(prevPin, LOW);</div>
|
||||
<div class="line">digitalWrite(nextPin, HIGH);</div>
|
||||
</div><!-- fragment --><p>This method may be overridden in subclasses to provide special effects. See the documentation for <a class="el" href="classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525" title="Returns the pin that is n steps back in the sequence.">previousPin()</a> for some example effects.</p>
|
||||
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525" title="Returns the pin that is n steps back in the sequence.">previousPin()</a> </dd></dl>
|
||||
</div><!-- fragment --><p>This method may be overridden in subclasses to provide special effects. See the documentation for <a class="el" href="classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525" title="Returns the pin that is n steps back in the sequence. ">previousPin()</a> for some example effects.</p>
|
||||
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525" title="Returns the pin that is n steps back in the sequence. ">previousPin()</a> </dd></dl>
|
||||
|
||||
<p>Definition at line <a class="el" href="ChaseLEDs_8cpp_source.html#l00136">136</a> of file <a class="el" href="ChaseLEDs_8cpp_source.html">ChaseLEDs.cpp</a>.</p>
|
||||
|
||||
@@ -234,7 +241,7 @@ Protected Member Functions</h2></td></tr>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Returns the number of milliseconds that each LED will be lit in the chase sequence. </p>
|
||||
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classChaseLEDs.html#af560270f72302c19fb7f95002089c9d7" title="Sets the number of milliseconds to advance between LED's to advanceTime.">setAdvanceTime()</a>, <a class="el" href="classChaseLEDs.html#aa0f4e0bd07dd65ee5574e894a612486b" title="Advances to the next LED in sequence, turning off prevPin, and turning on nextPin.">advance()</a> </dd></dl>
|
||||
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classChaseLEDs.html#af560270f72302c19fb7f95002089c9d7" title="Sets the number of milliseconds to advance between LED's to advanceTime. ">setAdvanceTime()</a>, <a class="el" href="classChaseLEDs.html#aa0f4e0bd07dd65ee5574e894a612486b" title="Advances to the next LED in sequence, turning off prevPin, and turning on nextPin. ">advance()</a> </dd></dl>
|
||||
|
||||
<p>Definition at line <a class="el" href="ChaseLEDs_8h_source.html#l00035">35</a> of file <a class="el" href="ChaseLEDs_8h_source.html">ChaseLEDs.h</a>.</p>
|
||||
|
||||
@@ -282,23 +289,23 @@ Protected Member Functions</h2></td></tr>
|
||||
|
||||
<p>Returns the pin that is <em>n</em> steps back in the sequence. </p>
|
||||
<p>If <em>n</em> is zero, then the current pin is returned; if <em>n</em> is 1, then the previous pin is returned; and so on.</p>
|
||||
<p>This function may be called by subclasses in their <a class="el" href="classChaseLEDs.html#aa0f4e0bd07dd65ee5574e894a612486b" title="Advances to the next LED in sequence, turning off prevPin, and turning on nextPin.">advance()</a> method to manipulate pins that are further back in the chase sequence than the immediately previous pin.</p>
|
||||
<p>This function may be called by subclasses in their <a class="el" href="classChaseLEDs.html#aa0f4e0bd07dd65ee5574e894a612486b" title="Advances to the next LED in sequence, turning off prevPin, and turning on nextPin. ">advance()</a> method to manipulate pins that are further back in the chase sequence than the immediately previous pin.</p>
|
||||
<p>For example, the following code implements a LED chaser that lights two pins at a time:</p>
|
||||
<div class="fragment"><div class="line"><span class="keywordtype">void</span> <a class="code" href="classChaseLEDs.html#aa0f4e0bd07dd65ee5574e894a612486b" title="Advances to the next LED in sequence, turning off prevPin, and turning on nextPin.">DoubleChaser::advance</a>(uint8_t prevPin, uint8_t nextPin)</div>
|
||||
<div class="fragment"><div class="line"><span class="keywordtype">void</span> DoubleChaser::advance(uint8_t prevPin, uint8_t nextPin)</div>
|
||||
<div class="line">{</div>
|
||||
<div class="line"> digitalWrite(<a class="code" href="classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525" title="Returns the pin that is n steps back in the sequence.">previousPin</a>(2), LOW);</div>
|
||||
<div class="line"> digitalWrite(<a class="code" href="classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525">previousPin</a>(2), LOW);</div>
|
||||
<div class="line"> digitalWrite(prevPin, HIGH);</div>
|
||||
<div class="line"> digitalWrite(nextPin, HIGH);</div>
|
||||
<div class="line">}</div>
|
||||
</div><!-- fragment --><p>As another exmaple, the following code uses PWM outputs to fade out the previous pin rather than turn it off immediately:</p>
|
||||
<div class="fragment"><div class="line"><span class="keywordtype">void</span> <a class="code" href="classChaseLEDs.html#aa0f4e0bd07dd65ee5574e894a612486b" title="Advances to the next LED in sequence, turning off prevPin, and turning on nextPin.">FadingChaser::advance</a>(uint8_t prevPin, uint8_t nextPin)</div>
|
||||
<div class="fragment"><div class="line"><span class="keywordtype">void</span> FadingChaser::advance(uint8_t prevPin, uint8_t nextPin)</div>
|
||||
<div class="line">{</div>
|
||||
<div class="line"> digitalWrite(<a class="code" href="classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525" title="Returns the pin that is n steps back in the sequence.">previousPin</a>(2), LOW);</div>
|
||||
<div class="line"> digitalWrite(<a class="code" href="classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525">previousPin</a>(2), LOW);</div>
|
||||
<div class="line"> analogWrite(prevPin, 32);</div>
|
||||
<div class="line"> digitalWrite(nextPin, HIGH);</div>
|
||||
<div class="line">}</div>
|
||||
</div><!-- fragment --><p>Note: it is possible to retrieve the <em>following</em> pin in sequence using previousPin(-1). This could be used to fade in the LED that follows <em>nextPin</em>.</p>
|
||||
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classChaseLEDs.html#aa0f4e0bd07dd65ee5574e894a612486b" title="Advances to the next LED in sequence, turning off prevPin, and turning on nextPin.">advance()</a> </dd></dl>
|
||||
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classChaseLEDs.html#aa0f4e0bd07dd65ee5574e894a612486b" title="Advances to the next LED in sequence, turning off prevPin, and turning on nextPin. ">advance()</a> </dd></dl>
|
||||
|
||||
<p>Definition at line <a class="el" href="ChaseLEDs_8h_source.html#l00040">40</a> of file <a class="el" href="ChaseLEDs_8h_source.html">ChaseLEDs.h</a>.</p>
|
||||
|
||||
@@ -327,7 +334,7 @@ Protected Member Functions</h2></td></tr>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Sets the number of milliseconds to advance between LED's to <em>advanceTime</em>. </p>
|
||||
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classChaseLEDs.html#aed060c51bb63dd8065be89f895989700" title="Returns the number of milliseconds that each LED will be lit in the chase sequence.">advanceTime()</a>, <a class="el" href="classChaseLEDs.html#aa0f4e0bd07dd65ee5574e894a612486b" title="Advances to the next LED in sequence, turning off prevPin, and turning on nextPin.">advance()</a> </dd></dl>
|
||||
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classChaseLEDs.html#aed060c51bb63dd8065be89f895989700" title="Returns the number of milliseconds that each LED will be lit in the chase sequence. ">advanceTime()</a>, <a class="el" href="classChaseLEDs.html#aa0f4e0bd07dd65ee5574e894a612486b" title="Advances to the next LED in sequence, turning off prevPin, and turning on nextPin. ">advance()</a> </dd></dl>
|
||||
|
||||
<p>Definition at line <a class="el" href="ChaseLEDs_8h_source.html#l00036">36</a> of file <a class="el" href="ChaseLEDs_8h_source.html">ChaseLEDs.h</a>.</p>
|
||||
|
||||
@@ -340,9 +347,9 @@ Protected Member Functions</h2></td></tr>
|
||||
</div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated on Sun Sep 29 2013 09:30:46 for ArduinoLibs by  <a href="http://www.doxygen.org/index.html">
|
||||
Generated on Thu Mar 12 2015 19:02:05 for ArduinoLibs by  <a href="http://www.doxygen.org/index.html">
|
||||
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
||||
</a> 1.8.1.2
|
||||
</a> 1.8.6
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user