1
0
mirror of https://github.com/taigrr/arduinolibs synced 2025-01-18 04:33:12 -08:00

Initial doc commit

This commit is contained in:
Rhys Weatherley 2012-05-25 15:12:09 +10:00
commit eead6a8a1f
215 changed files with 24649 additions and 0 deletions

180
BlinkLED_8cpp_source.html Normal file
View File

@ -0,0 +1,180 @@
<!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"/>
<title>ArduinoLibs: BlinkLED.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">BlinkLED.cpp</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;BlinkLED.h&quot;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#if defined(ARDUINO) &amp;&amp; ARDUINO &gt;= 100</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#include &lt;Arduino.h&gt;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#else</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#include &lt;WProgram.h&gt;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#endif</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span>
<a name="l00064"></a><a class="code" href="classBlinkLED.html#afc33958651e7ce6dceb428ea654c2c2f">00064</a> <a class="code" href="classBlinkLED.html#afc33958651e7ce6dceb428ea654c2c2f" title="Initialize a blinking LED on the specified pin.">BlinkLED::BlinkLED</a>(uint8_t pin, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> onTime, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> offTime, <span class="keywordtype">bool</span> initialState)
<a name="l00065"></a>00065 : _pin(pin)
<a name="l00066"></a>00066 , _state(initialState)
<a name="l00067"></a>00067 , _paused(false)
<a name="l00068"></a>00068 , _onTime(onTime)
<a name="l00069"></a>00069 , _offTime(offTime)
<a name="l00070"></a>00070 {
<a name="l00071"></a>00071 pinMode(pin, OUTPUT);
<a name="l00072"></a>00072 digitalWrite(pin, initialState ? HIGH : LOW);
<a name="l00073"></a>00073 _lastChange = millis();
<a name="l00074"></a>00074 }
<a name="l00075"></a>00075
<a name="l00079"></a><a class="code" href="classBlinkLED.html#aeeaf42b94c5392935f00f0f12a58c75e">00079</a> <span class="keywordtype">void</span> <a class="code" href="classBlinkLED.html#aeeaf42b94c5392935f00f0f12a58c75e">BlinkLED::loop</a>()
<a name="l00080"></a>00080 {
<a name="l00081"></a>00081 <span class="keywordflow">if</span> (_paused)
<a name="l00082"></a>00082 <span class="keywordflow">return</span>;
<a name="l00083"></a>00083 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> currentTime = millis();
<a name="l00084"></a>00084 <span class="keywordflow">if</span> (_state) {
<a name="l00085"></a>00085 <span class="keywordflow">if</span> ((currentTime - _lastChange) &gt;= _onTime) {
<a name="l00086"></a>00086 digitalWrite(_pin, LOW);
<a name="l00087"></a>00087 _lastChange += _onTime;
<a name="l00088"></a>00088 _state = <span class="keyword">false</span>;
<a name="l00089"></a>00089 }
<a name="l00090"></a>00090 } <span class="keywordflow">else</span> {
<a name="l00091"></a>00091 <span class="keywordflow">if</span> ((currentTime - _lastChange) &gt;= _offTime) {
<a name="l00092"></a>00092 digitalWrite(_pin, HIGH);
<a name="l00093"></a>00093 _lastChange += _offTime;
<a name="l00094"></a>00094 _state = <span class="keyword">true</span>;
<a name="l00095"></a>00095 }
<a name="l00096"></a>00096 }
<a name="l00097"></a>00097 }
<a name="l00098"></a>00098
<a name="l00122"></a><a class="code" href="classBlinkLED.html#a47f95624881063aa91c0066ed2c92258">00122</a> <span class="keywordtype">void</span> <a class="code" href="classBlinkLED.html#a47f95624881063aa91c0066ed2c92258" title="Sets the onTime and offTime (in milliseconds).">BlinkLED::setBlinkRate</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> onTime, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> offTime)
<a name="l00123"></a>00123 {
<a name="l00124"></a>00124 _onTime = <a class="code" href="classBlinkLED.html#a8475f78f41d1a2d5d719bec8cbbb3ebb" title="Returns the number of milliseconds the LED will be on.">onTime</a>;
<a name="l00125"></a>00125 _offTime = <a class="code" href="classBlinkLED.html#a74c640edf1a9f6e8bea1e139462908bc" title="Returns the number of milliseconds the LED will be off.">offTime</a>;
<a name="l00126"></a>00126 }
<a name="l00127"></a>00127
<a name="l00145"></a><a class="code" href="classBlinkLED.html#af904a345e56d49948a042ac439d0b9d4">00145</a> <span class="keywordtype">void</span> <a class="code" href="classBlinkLED.html#af904a345e56d49948a042ac439d0b9d4" title="Sets the current state of the LED, where true is on, false is off.">BlinkLED::setState</a>(<span class="keywordtype">bool</span> state)
<a name="l00146"></a>00146 {
<a name="l00147"></a>00147 <span class="keywordflow">if</span> (_state != state) {
<a name="l00148"></a>00148 digitalWrite(_pin, state ? HIGH : LOW);
<a name="l00149"></a>00149 _state = <a class="code" href="classBlinkLED.html#ab89b5b3435998ea6699d4bf94866e233" title="Returns the current state of the LED; true is on, false is off.">state</a>;
<a name="l00150"></a>00150 _lastChange = millis();
<a name="l00151"></a>00151 }
<a name="l00152"></a>00152 }
<a name="l00153"></a>00153
<a name="l00170"></a><a class="code" href="classBlinkLED.html#a380241e4dfd20e8a558487227f2f4252">00170</a> <span class="keywordtype">void</span> <a class="code" href="classBlinkLED.html#a380241e4dfd20e8a558487227f2f4252" title="Resumes the LED blink cycle after a pause().">BlinkLED::resume</a>()
<a name="l00171"></a>00171 {
<a name="l00172"></a>00172 <span class="keywordflow">if</span> (_paused) {
<a name="l00173"></a>00173 _paused = <span class="keyword">false</span>;
<a name="l00174"></a>00174 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> currentTime = millis();
<a name="l00175"></a>00175 <span class="keywordflow">if</span> (_state) {
<a name="l00176"></a>00176 <span class="keywordflow">if</span> ((currentTime - _lastChange) &gt;= _onTime) {
<a name="l00177"></a>00177 digitalWrite(_pin, LOW);
<a name="l00178"></a>00178 _lastChange = currentTime;
<a name="l00179"></a>00179 _state = <span class="keyword">false</span>;
<a name="l00180"></a>00180 }
<a name="l00181"></a>00181 } <span class="keywordflow">else</span> {
<a name="l00182"></a>00182 <span class="keywordflow">if</span> ((currentTime - _lastChange) &gt;= _offTime) {
<a name="l00183"></a>00183 digitalWrite(_pin, HIGH);
<a name="l00184"></a>00184 _lastChange = currentTime;
<a name="l00185"></a>00185 _state = <span class="keyword">true</span>;
<a name="l00186"></a>00186 }
<a name="l00187"></a>00187 }
<a name="l00188"></a>00188 }
<a name="l00189"></a>00189 }
<a name="l00190"></a>00190
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:49 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

138
BlinkLED_8h_source.html Normal file
View File

@ -0,0 +1,138 @@
<!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"/>
<title>ArduinoLibs: BlinkLED.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">BlinkLED.h</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#ifndef BlinkLED_h</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define BlinkLED_h</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;inttypes.h&gt;</span>
<a name="l00027"></a>00027
<a name="l00028"></a><a class="code" href="classBlinkLED.html">00028</a> <span class="keyword">class </span><a class="code" href="classBlinkLED.html" title="Blink a LED on a digital output pin.">BlinkLED</a>
<a name="l00029"></a>00029 {
<a name="l00030"></a>00030 <span class="keyword">public</span>:
<a name="l00031"></a>00031 <a class="code" href="classBlinkLED.html#afc33958651e7ce6dceb428ea654c2c2f" title="Initialize a blinking LED on the specified pin.">BlinkLED</a>(uint8_t pin, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="classBlinkLED.html#a8475f78f41d1a2d5d719bec8cbbb3ebb" title="Returns the number of milliseconds the LED will be on.">onTime</a>, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="classBlinkLED.html#a74c640edf1a9f6e8bea1e139462908bc" title="Returns the number of milliseconds the LED will be off.">offTime</a>, <span class="keywordtype">bool</span> initialState = <span class="keyword">false</span>);
<a name="l00032"></a>00032
<a name="l00033"></a>00033 <span class="keywordtype">void</span> <a class="code" href="classBlinkLED.html#aeeaf42b94c5392935f00f0f12a58c75e">loop</a>();
<a name="l00034"></a>00034
<a name="l00035"></a><a class="code" href="classBlinkLED.html#a8475f78f41d1a2d5d719bec8cbbb3ebb">00035</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="classBlinkLED.html#a8475f78f41d1a2d5d719bec8cbbb3ebb" title="Returns the number of milliseconds the LED will be on.">onTime</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _onTime; }
<a name="l00036"></a><a class="code" href="classBlinkLED.html#a74c640edf1a9f6e8bea1e139462908bc">00036</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="classBlinkLED.html#a74c640edf1a9f6e8bea1e139462908bc" title="Returns the number of milliseconds the LED will be off.">offTime</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _offTime; }
<a name="l00037"></a>00037 <span class="keywordtype">void</span> <a class="code" href="classBlinkLED.html#a47f95624881063aa91c0066ed2c92258" title="Sets the onTime and offTime (in milliseconds).">setBlinkRate</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> onTime, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> offTime);
<a name="l00038"></a>00038
<a name="l00039"></a><a class="code" href="classBlinkLED.html#ab89b5b3435998ea6699d4bf94866e233">00039</a> <span class="keywordtype">bool</span> <a class="code" href="classBlinkLED.html#ab89b5b3435998ea6699d4bf94866e233" title="Returns the current state of the LED; true is on, false is off.">state</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _state; }
<a name="l00040"></a>00040 <span class="keywordtype">void</span> <a class="code" href="classBlinkLED.html#af904a345e56d49948a042ac439d0b9d4" title="Sets the current state of the LED, where true is on, false is off.">setState</a>(<span class="keywordtype">bool</span> <a class="code" href="classBlinkLED.html#ab89b5b3435998ea6699d4bf94866e233" title="Returns the current state of the LED; true is on, false is off.">state</a>);
<a name="l00041"></a>00041
<a name="l00042"></a><a class="code" href="classBlinkLED.html#a2760a0223cd6a0598b961f681ffb5c0a">00042</a> <span class="keywordtype">void</span> <a class="code" href="classBlinkLED.html#a2760a0223cd6a0598b961f681ffb5c0a" title="Pauses the LED blink cycle in its current state().">pause</a>() { _paused = <span class="keyword">true</span>; }
<a name="l00043"></a>00043 <span class="keywordtype">void</span> <a class="code" href="classBlinkLED.html#a380241e4dfd20e8a558487227f2f4252" title="Resumes the LED blink cycle after a pause().">resume</a>();
<a name="l00044"></a><a class="code" href="classBlinkLED.html#aa0ee318b886b84fb71d5831fa456ecc8">00044</a> <span class="keywordtype">bool</span> <a class="code" href="classBlinkLED.html#aa0ee318b886b84fb71d5831fa456ecc8" title="Returns true if the LED blink cycle is paused; false otherwise.">isPaused</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _paused; }
<a name="l00045"></a>00045
<a name="l00046"></a>00046 <span class="keyword">private</span>:
<a name="l00047"></a>00047 uint8_t _pin;
<a name="l00048"></a>00048 <span class="keywordtype">bool</span> _state;
<a name="l00049"></a>00049 <span class="keywordtype">bool</span> _paused;
<a name="l00050"></a>00050 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> _onTime;
<a name="l00051"></a>00051 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> _offTime;
<a name="l00052"></a>00052 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> _lastChange;
<a name="l00053"></a>00053 };
<a name="l00054"></a>00054
<a name="l00055"></a>00055 <span class="preprocessor">#endif</span>
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:49 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

180
BoolField_8cpp_source.html Normal file
View File

@ -0,0 +1,180 @@
<!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"/>
<title>ArduinoLibs: BoolField.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">BoolField.cpp</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;BoolField.h&quot;</span>
<a name="l00024"></a>00024
<a name="l00077"></a><a class="code" href="classBoolField.html#a5d4382cdcdc989de0179d8f3f3a59998">00077</a> <a class="code" href="classBoolField.html#a5d4382cdcdc989de0179d8f3f3a59998" title="Constructs a new boolean field with a specific label.">BoolField::BoolField</a>(<span class="keyword">const</span> String &amp;label)
<a name="l00078"></a>00078 : <a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a>(label)
<a name="l00079"></a>00079 , _printLen(0)
<a name="l00080"></a>00080 , _value(false)
<a name="l00081"></a>00081 {
<a name="l00082"></a>00082 }
<a name="l00083"></a>00083
<a name="l00094"></a><a class="code" href="classBoolField.html#a49aad212ed18f84baa105c24e86281d9">00094</a> <a class="code" href="classBoolField.html#a5d4382cdcdc989de0179d8f3f3a59998" title="Constructs a new boolean field with a specific label.">BoolField::BoolField</a>(<a class="code" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> &amp;form, <span class="keyword">const</span> String &amp;label, <span class="keyword">const</span> String &amp;trueLabel, <span class="keyword">const</span> String &amp;falseLabel, <span class="keywordtype">bool</span> value)
<a name="l00095"></a>00095 : <a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a>(form, label)
<a name="l00096"></a>00096 , _trueLabel(trueLabel)
<a name="l00097"></a>00097 , _falseLabel(falseLabel)
<a name="l00098"></a>00098 , _printLen(0)
<a name="l00099"></a>00099 , _value(value)
<a name="l00100"></a>00100 {
<a name="l00101"></a>00101 }
<a name="l00102"></a>00102
<a name="l00103"></a><a class="code" href="classBoolField.html#af793bafc1193d79b495c2ede711bca57">00103</a> <span class="keywordtype">int</span> <a class="code" href="classBoolField.html#af793bafc1193d79b495c2ede711bca57" title="Dispatches event via this field.">BoolField::dispatch</a>(<span class="keywordtype">int</span> event)
<a name="l00104"></a>00104 {
<a name="l00105"></a>00105 <span class="keywordflow">if</span> (event == LCD_BUTTON_UP || event == LCD_BUTTON_DOWN) {
<a name="l00106"></a>00106 <a class="code" href="classBoolField.html#a080c575fd4a98e6afc4b9197fbab5577" title="Sets the current value of this field to value.">setValue</a>(!_value);
<a name="l00107"></a>00107 <span class="keywordflow">return</span> FORM_CHANGED;
<a name="l00108"></a>00108 } <span class="keywordflow">else</span> {
<a name="l00109"></a>00109 <span class="keywordflow">return</span> -1;
<a name="l00110"></a>00110 }
<a name="l00111"></a>00111 }
<a name="l00112"></a>00112
<a name="l00113"></a><a class="code" href="classBoolField.html#ab3f1e610b52caed7e41016f6ae3d7d09">00113</a> <span class="keywordtype">void</span> <a class="code" href="classBoolField.html#ab3f1e610b52caed7e41016f6ae3d7d09" title="Enters the field due to form navigation.">BoolField::enterField</a>(<span class="keywordtype">bool</span> reverse)
<a name="l00114"></a>00114 {
<a name="l00115"></a>00115 <a class="code" href="classBoolField.html#ab3f1e610b52caed7e41016f6ae3d7d09" title="Enters the field due to form navigation.">Field::enterField</a>(reverse);
<a name="l00116"></a>00116 printValue();
<a name="l00117"></a>00117 }
<a name="l00118"></a>00118
<a name="l00131"></a><a class="code" href="classBoolField.html#a080c575fd4a98e6afc4b9197fbab5577">00131</a> <span class="keywordtype">void</span> <a class="code" href="classBoolField.html#a080c575fd4a98e6afc4b9197fbab5577" title="Sets the current value of this field to value.">BoolField::setValue</a>(<span class="keywordtype">bool</span> value)
<a name="l00132"></a>00132 {
<a name="l00133"></a>00133 <span class="keywordflow">if</span> (value != _value) {
<a name="l00134"></a>00134 _value = <a class="code" href="classBoolField.html#a9147826437fbaf9b29eda9dee9e37b39" title="Returns the current value of this field, true or false.">value</a>;
<a name="l00135"></a>00135 <span class="keywordflow">if</span> (<a class="code" href="classField.html#a25d86a67b321e8c642edf75a10a35f72" title="Returns true if this field is the currently-displayed field in its owning form; false otherwise...">isCurrent</a>())
<a name="l00136"></a>00136 printValue();
<a name="l00137"></a>00137 }
<a name="l00138"></a>00138 }
<a name="l00139"></a>00139
<a name="l00153"></a><a class="code" href="classBoolField.html#a803fc8c39765da4a44af01d925cd4194">00153</a> <span class="keywordtype">void</span> <a class="code" href="classBoolField.html#a803fc8c39765da4a44af01d925cd4194" title="Sets the string that is displayed when value() is true to trueLabel.">BoolField::setTrueLabel</a>(<span class="keyword">const</span> String &amp;trueLabel)
<a name="l00154"></a>00154 {
<a name="l00155"></a>00155 _trueLabel = <a class="code" href="classBoolField.html#a9972030beec6e007b556c6eb652e163d" title="Returns the string that is displayed when value() is true.">trueLabel</a>;
<a name="l00156"></a>00156 <span class="keywordflow">if</span> (<a class="code" href="classField.html#a25d86a67b321e8c642edf75a10a35f72" title="Returns true if this field is the currently-displayed field in its owning form; false otherwise...">isCurrent</a>())
<a name="l00157"></a>00157 printValue();
<a name="l00158"></a>00158 }
<a name="l00159"></a>00159
<a name="l00173"></a><a class="code" href="classBoolField.html#ae6a29d27139fd78f2ca96152059fb30a">00173</a> <span class="keywordtype">void</span> <a class="code" href="classBoolField.html#ae6a29d27139fd78f2ca96152059fb30a" title="Sets the string that is displayed when value() is false to falseLabel.">BoolField::setFalseLabel</a>(<span class="keyword">const</span> String &amp;falseLabel)
<a name="l00174"></a>00174 {
<a name="l00175"></a>00175 _falseLabel = <a class="code" href="classBoolField.html#a59ad7a8a33290bda0d9fbb3df4f09b01" title="Returns the string that is displayed when value() is false.">falseLabel</a>;
<a name="l00176"></a>00176 <span class="keywordflow">if</span> (<a class="code" href="classField.html#a25d86a67b321e8c642edf75a10a35f72" title="Returns true if this field is the currently-displayed field in its owning form; false otherwise...">isCurrent</a>())
<a name="l00177"></a>00177 printValue();
<a name="l00178"></a>00178 }
<a name="l00179"></a>00179
<a name="l00180"></a>00180 <span class="keywordtype">void</span> BoolField::printValue()
<a name="l00181"></a>00181 {
<a name="l00182"></a>00182 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> len;
<a name="l00183"></a>00183 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;setCursor(0, 1);
<a name="l00184"></a>00184 <span class="keywordflow">if</span> (_value) {
<a name="l00185"></a>00185 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;print(_trueLabel);
<a name="l00186"></a>00186 len = _trueLabel.length();
<a name="l00187"></a>00187 <span class="keywordflow">while</span> (len++ &lt; _printLen)
<a name="l00188"></a>00188 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;write(<span class="charliteral">&#39; &#39;</span>);
<a name="l00189"></a>00189 _printLen = _trueLabel.length();
<a name="l00190"></a>00190 } <span class="keywordflow">else</span> {
<a name="l00191"></a>00191 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;print(_falseLabel);
<a name="l00192"></a>00192 len = _falseLabel.length();
<a name="l00193"></a>00193 <span class="keywordflow">while</span> (len++ &lt; _printLen)
<a name="l00194"></a>00194 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;write(<span class="charliteral">&#39; &#39;</span>);
<a name="l00195"></a>00195 _printLen = _falseLabel.length();
<a name="l00196"></a>00196 }
<a name="l00197"></a>00197 }
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:49 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

138
BoolField_8h_source.html Normal file
View File

@ -0,0 +1,138 @@
<!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"/>
<title>ArduinoLibs: BoolField.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">BoolField.h</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#ifndef BoolField_h</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define BoolField_h</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &quot;Field.h&quot;</span>
<a name="l00027"></a>00027
<a name="l00028"></a><a class="code" href="classBoolField.html">00028</a> <span class="keyword">class </span><a class="code" href="classBoolField.html" title="Field that manages the input of a boolean value.">BoolField</a> : <span class="keyword">public</span> <a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> {
<a name="l00029"></a>00029 <span class="keyword">public</span>:
<a name="l00030"></a>00030 <span class="keyword">explicit</span> <a class="code" href="classBoolField.html#a5d4382cdcdc989de0179d8f3f3a59998" title="Constructs a new boolean field with a specific label.">BoolField</a>(<span class="keyword">const</span> String &amp;<a class="code" href="classField.html#aaa861ef917130c989a955bc75c683afe" title="Returns the label to display in the first line of this field.">label</a>);
<a name="l00031"></a>00031 <a class="code" href="classBoolField.html#a5d4382cdcdc989de0179d8f3f3a59998" title="Constructs a new boolean field with a specific label.">BoolField</a>(<a class="code" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> &amp;<a class="code" href="classField.html#a27427319be1cc92db3128637d8884ee5" title="Returns the Form that owns this field; null if not associated with a Form.">form</a>, <span class="keyword">const</span> String &amp;label, <span class="keyword">const</span> String &amp;<a class="code" href="classBoolField.html#a9972030beec6e007b556c6eb652e163d" title="Returns the string that is displayed when value() is true.">trueLabel</a>, <span class="keyword">const</span> String &amp;<a class="code" href="classBoolField.html#a59ad7a8a33290bda0d9fbb3df4f09b01" title="Returns the string that is displayed when value() is false.">falseLabel</a>, <span class="keywordtype">bool</span> <a class="code" href="classBoolField.html#a9147826437fbaf9b29eda9dee9e37b39" title="Returns the current value of this field, true or false.">value</a>);
<a name="l00032"></a>00032
<a name="l00033"></a>00033 <span class="keywordtype">int</span> <a class="code" href="classBoolField.html#af793bafc1193d79b495c2ede711bca57" title="Dispatches event via this field.">dispatch</a>(<span class="keywordtype">int</span> event);
<a name="l00034"></a>00034
<a name="l00035"></a>00035 <span class="keywordtype">void</span> <a class="code" href="classBoolField.html#ab3f1e610b52caed7e41016f6ae3d7d09" title="Enters the field due to form navigation.">enterField</a>(<span class="keywordtype">bool</span> reverse);
<a name="l00036"></a>00036
<a name="l00037"></a><a class="code" href="classBoolField.html#a9147826437fbaf9b29eda9dee9e37b39">00037</a> <span class="keywordtype">bool</span> <a class="code" href="classBoolField.html#a9147826437fbaf9b29eda9dee9e37b39" title="Returns the current value of this field, true or false.">value</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _value; }
<a name="l00038"></a>00038 <span class="keywordtype">void</span> <a class="code" href="classBoolField.html#a080c575fd4a98e6afc4b9197fbab5577" title="Sets the current value of this field to value.">setValue</a>(<span class="keywordtype">bool</span> value);
<a name="l00039"></a>00039
<a name="l00040"></a><a class="code" href="classBoolField.html#a9972030beec6e007b556c6eb652e163d">00040</a> <span class="keyword">const</span> String &amp;<a class="code" href="classBoolField.html#a9972030beec6e007b556c6eb652e163d" title="Returns the string that is displayed when value() is true.">trueLabel</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _trueLabel; }
<a name="l00041"></a>00041 <span class="keywordtype">void</span> <a class="code" href="classBoolField.html#a803fc8c39765da4a44af01d925cd4194" title="Sets the string that is displayed when value() is true to trueLabel.">setTrueLabel</a>(<span class="keyword">const</span> String &amp;trueLabel);
<a name="l00042"></a>00042
<a name="l00043"></a><a class="code" href="classBoolField.html#a59ad7a8a33290bda0d9fbb3df4f09b01">00043</a> <span class="keyword">const</span> String &amp;<a class="code" href="classBoolField.html#a59ad7a8a33290bda0d9fbb3df4f09b01" title="Returns the string that is displayed when value() is false.">falseLabel</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _falseLabel; }
<a name="l00044"></a>00044 <span class="keywordtype">void</span> <a class="code" href="classBoolField.html#ae6a29d27139fd78f2ca96152059fb30a" title="Sets the string that is displayed when value() is false to falseLabel.">setFalseLabel</a>(<span class="keyword">const</span> String &amp;falseLabel);
<a name="l00045"></a>00045
<a name="l00046"></a>00046 <span class="keyword">private</span>:
<a name="l00047"></a>00047 String _trueLabel;
<a name="l00048"></a>00048 String _falseLabel;
<a name="l00049"></a>00049 <span class="keywordtype">int</span> _printLen;
<a name="l00050"></a>00050 <span class="keywordtype">bool</span> _value;
<a name="l00051"></a>00051
<a name="l00052"></a>00052 <span class="keywordtype">void</span> printValue();
<a name="l00053"></a>00053 };
<a name="l00054"></a>00054
<a name="l00055"></a>00055 <span class="preprocessor">#endif</span>
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:49 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

148
ChaseLEDs_8cpp_source.html Normal file
View File

@ -0,0 +1,148 @@
<!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"/>
<title>ArduinoLibs: ChaseLEDs.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">ChaseLEDs.cpp</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;ChaseLEDs.h&quot;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#if defined(ARDUINO) &amp;&amp; ARDUINO &gt;= 100</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#include &lt;Arduino.h&gt;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#else</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#include &lt;WProgram.h&gt;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#endif</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span>
<a name="l00071"></a><a class="code" href="classChaseLEDs.html#ab6bb3da371d3730a6552e93a9b2eab78">00071</a> <a class="code" href="classChaseLEDs.html#ab6bb3da371d3730a6552e93a9b2eab78" title="Initializes the LED chaser.">ChaseLEDs::ChaseLEDs</a>(<span class="keyword">const</span> uint8_t *pins, <span class="keywordtype">int</span> num, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> advanceTime)
<a name="l00072"></a>00072 : _pins(pins)
<a name="l00073"></a>00073 , _numPins(num)
<a name="l00074"></a>00074 , _currentIndex(-1)
<a name="l00075"></a>00075 , _advanceTime(advanceTime)
<a name="l00076"></a>00076 , _lastChange(millis())
<a name="l00077"></a>00077 {
<a name="l00078"></a>00078 <span class="keywordflow">for</span> (uint8_t index = 0; index &lt; _numPins; ++index) {
<a name="l00079"></a>00079 pinMode(_pins[index], OUTPUT);
<a name="l00080"></a>00080 digitalWrite(_pins[index], LOW);
<a name="l00081"></a>00081 }
<a name="l00082"></a>00082 }
<a name="l00083"></a>00083
<a name="l00087"></a><a class="code" href="classChaseLEDs.html#a8745fa6b9f33b6c6274a563dd4dea786">00087</a> <span class="keywordtype">void</span> <a class="code" href="classChaseLEDs.html#a8745fa6b9f33b6c6274a563dd4dea786">ChaseLEDs::loop</a>()
<a name="l00088"></a>00088 {
<a name="l00089"></a>00089 <span class="keywordflow">if</span> (_currentIndex &gt;= 0) {
<a name="l00090"></a>00090 <span class="keywordflow">if</span> ((millis() - _lastChange) &gt;= _advanceTime) {
<a name="l00091"></a>00091 <span class="comment">// Advance to the next LED in sequence.</span>
<a name="l00092"></a>00092 _currentIndex = (_currentIndex + 1) % _numPins;
<a name="l00093"></a>00093 _lastChange += _advanceTime;
<a name="l00094"></a>00094 <a class="code" href="classChaseLEDs.html#aa0f4e0bd07dd65ee5574e894a612486b" title="Advances to the next LED in sequence, turning off prevPin, and turning on nextPin.">advance</a>(<a class="code" href="classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525" title="Returns the pin that is n steps back in the sequence.">previousPin</a>(1), _pins[_currentIndex]);
<a name="l00095"></a>00095 }
<a name="l00096"></a>00096 } <span class="keywordflow">else</span> {
<a name="l00097"></a>00097 <span class="comment">// First time - light the first LED.</span>
<a name="l00098"></a>00098 _currentIndex = 0;
<a name="l00099"></a>00099 _lastChange = millis();
<a name="l00100"></a>00100 <a class="code" href="classChaseLEDs.html#aa0f4e0bd07dd65ee5574e894a612486b" title="Advances to the next LED in sequence, turning off prevPin, and turning on nextPin.">advance</a>(<a class="code" href="classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525" title="Returns the pin that is n steps back in the sequence.">previousPin</a>(1), _pins[_currentIndex]);
<a name="l00101"></a>00101 }
<a name="l00102"></a>00102 }
<a name="l00103"></a>00103
<a name="l00136"></a><a class="code" href="classChaseLEDs.html#aa0f4e0bd07dd65ee5574e894a612486b">00136</a> <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.">ChaseLEDs::advance</a>(uint8_t prevPin, uint8_t nextPin)
<a name="l00137"></a>00137 {
<a name="l00138"></a>00138 digitalWrite(prevPin, LOW);
<a name="l00139"></a>00139 digitalWrite(nextPin, HIGH);
<a name="l00140"></a>00140 }
<a name="l00141"></a>00141
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:49 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

134
ChaseLEDs_8h_source.html Normal file
View File

@ -0,0 +1,134 @@
<!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"/>
<title>ArduinoLibs: ChaseLEDs.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">ChaseLEDs.h</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#ifndef ChaseLEDs_h</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define ChaseLEDs_h</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;inttypes.h&gt;</span>
<a name="l00027"></a>00027
<a name="l00028"></a><a class="code" href="classChaseLEDs.html">00028</a> <span class="keyword">class </span><a class="code" href="classChaseLEDs.html" title="Chase LED&#39;s on output pins in a defined sequence.">ChaseLEDs</a>
<a name="l00029"></a>00029 {
<a name="l00030"></a>00030 <span class="keyword">public</span>:
<a name="l00031"></a>00031 <a class="code" href="classChaseLEDs.html#ab6bb3da371d3730a6552e93a9b2eab78" title="Initializes the LED chaser.">ChaseLEDs</a>(<span class="keyword">const</span> uint8_t *pins, <span class="keywordtype">int</span> num, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="classChaseLEDs.html#aed060c51bb63dd8065be89f895989700" title="Returns the number of milliseconds that each LED will be lit in the chase sequence.">advanceTime</a>);
<a name="l00032"></a>00032
<a name="l00033"></a>00033 <span class="keywordtype">void</span> <a class="code" href="classChaseLEDs.html#a8745fa6b9f33b6c6274a563dd4dea786">loop</a>();
<a name="l00034"></a>00034
<a name="l00035"></a><a class="code" href="classChaseLEDs.html#aed060c51bb63dd8065be89f895989700">00035</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="classChaseLEDs.html#aed060c51bb63dd8065be89f895989700" title="Returns the number of milliseconds that each LED will be lit in the chase sequence.">advanceTime</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _advanceTime; }
<a name="l00036"></a><a class="code" href="classChaseLEDs.html#af560270f72302c19fb7f95002089c9d7">00036</a> <span class="keywordtype">void</span> <a class="code" href="classChaseLEDs.html#af560270f72302c19fb7f95002089c9d7" title="Sets the number of milliseconds to advance between LED&#39;s to advanceTime.">setAdvanceTime</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> advanceTime) { _advanceTime = <a class="code" href="classChaseLEDs.html#aed060c51bb63dd8065be89f895989700" title="Returns the number of milliseconds that each LED will be lit in the chase sequence.">advanceTime</a>; }
<a name="l00037"></a>00037
<a name="l00038"></a>00038 <span class="keyword">protected</span>:
<a name="l00039"></a>00039 <span class="keyword">virtual</span> <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.">advance</a>(uint8_t prevPin, uint8_t nextPin);
<a name="l00040"></a><a class="code" href="classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525">00040</a> uint8_t <a class="code" href="classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525" title="Returns the pin that is n steps back in the sequence.">previousPin</a>(<span class="keywordtype">int</span> n)<span class="keyword"> const</span>
<a name="l00041"></a>00041 <span class="keyword"> </span>{ <span class="keywordflow">return</span> _pins[(_currentIndex + _numPins - n) % _numPins]; }
<a name="l00042"></a>00042
<a name="l00043"></a>00043 <span class="keyword">private</span>:
<a name="l00044"></a>00044 <span class="keyword">const</span> uint8_t *_pins;
<a name="l00045"></a>00045 <span class="keywordtype">int</span> _numPins;
<a name="l00046"></a>00046 <span class="keywordtype">int</span> _currentIndex;
<a name="l00047"></a>00047 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> _advanceTime;
<a name="l00048"></a>00048 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> _lastChange;
<a name="l00049"></a>00049 };
<a name="l00050"></a>00050
<a name="l00051"></a>00051 <span class="preprocessor">#endif</span>
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:49 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

BIN
Cylon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
Cylon4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

369
DS1307RTC_8cpp_source.html Normal file
View File

@ -0,0 +1,369 @@
<!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"/>
<title>ArduinoLibs: DS1307RTC.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">DS1307RTC.cpp</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;DS1307RTC.h&quot;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &quot;../I2C/I2CMaster.h&quot;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#if defined(ARDUINO) &amp;&amp; ARDUINO &gt;= 100</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#include &lt;Arduino.h&gt;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#else</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span><span class="preprocessor">#include &lt;WProgram.h&gt;</span>
<a name="l00029"></a>00029 <span class="preprocessor">#endif</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span>
<a name="l00054"></a>00054 <span class="comment">// I2C address of the RTC chip (7-bit).</span>
<a name="l00055"></a>00055 <span class="preprocessor">#define DS1307_I2C_ADDRESS 0x68</span>
<a name="l00056"></a>00056 <span class="preprocessor"></span>
<a name="l00057"></a>00057 <span class="comment">// Registers.</span>
<a name="l00058"></a>00058 <span class="preprocessor">#define DS1307_SECOND 0x00</span>
<a name="l00059"></a>00059 <span class="preprocessor"></span><span class="preprocessor">#define DS1307_MINUTE 0x01</span>
<a name="l00060"></a>00060 <span class="preprocessor"></span><span class="preprocessor">#define DS1307_HOUR 0x02</span>
<a name="l00061"></a>00061 <span class="preprocessor"></span><span class="preprocessor">#define DS1307_DAY_OF_WEEK 0x03</span>
<a name="l00062"></a>00062 <span class="preprocessor"></span><span class="preprocessor">#define DS1307_DATE 0x04</span>
<a name="l00063"></a>00063 <span class="preprocessor"></span><span class="preprocessor">#define DS1307_MONTH 0x05</span>
<a name="l00064"></a>00064 <span class="preprocessor"></span><span class="preprocessor">#define DS1307_YEAR 0x06</span>
<a name="l00065"></a>00065 <span class="preprocessor"></span><span class="preprocessor">#define DS1307_CONTROL 0x07</span>
<a name="l00066"></a>00066 <span class="preprocessor"></span><span class="preprocessor">#define DS1307_NVRAM 0x08</span>
<a name="l00067"></a>00067 <span class="preprocessor"></span>
<a name="l00068"></a>00068 <span class="comment">// Alarm storage at the end of the RTC&#39;s NVRAM.</span>
<a name="l00069"></a>00069 <span class="preprocessor">#define DS1307_ALARM_SIZE 3</span>
<a name="l00070"></a>00070 <span class="preprocessor"></span><span class="preprocessor">#define DS1307_ALARMS (64 - RTC::ALARM_COUNT * DS1307_ALARM_SIZE - 1)</span>
<a name="l00071"></a>00071 <span class="preprocessor"></span><span class="preprocessor">#define DS1307_ALARM_MAGIC 63</span>
<a name="l00072"></a>00072 <span class="preprocessor"></span>
<a name="l00083"></a><a class="code" href="classDS1307RTC.html#a092805d75bea323dc4be062638bff866">00083</a> <a class="code" href="classDS1307RTC.html#a092805d75bea323dc4be062638bff866" title="Attaches to a realtime clock slave device on bus.">DS1307RTC::DS1307RTC</a>(<a class="code" href="classI2CMaster.html" title="Abstract base class for I2C master implementations.">I2CMaster</a> &amp;bus, uint8_t oneHzPin)
<a name="l00084"></a>00084 : _bus(&amp;bus)
<a name="l00085"></a>00085 , _oneHzPin(oneHzPin)
<a name="l00086"></a>00086 , prevOneHz(false)
<a name="l00087"></a>00087 , _isRealTime(true)
<a name="l00088"></a>00088 {
<a name="l00089"></a>00089 <span class="comment">// Make sure the CH bit in register 0 is off or the clock won&#39;t update.</span>
<a name="l00090"></a>00090 _bus-&gt;<a class="code" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite</a>(DS1307_I2C_ADDRESS);
<a name="l00091"></a>00091 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(DS1307_SECOND);
<a name="l00092"></a>00092 <span class="keywordflow">if</span> (_bus-&gt;<a class="code" href="classI2CMaster.html#a4e5f1a1a4c2242699be5a35fc4872fde" title="Starts a read operation for count bytes by sending the start condition and the I2C control byte...">startRead</a>(DS1307_I2C_ADDRESS, 1)) {
<a name="l00093"></a>00093 uint8_t value = _bus-&gt;<a class="code" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd" title="Reads a single byte from the I2C bus.">read</a>();
<a name="l00094"></a>00094 <span class="keywordflow">if</span> ((value &amp; 0x80) != 0)
<a name="l00095"></a>00095 writeRegister(DS1307_SECOND, value &amp; 0x7F);
<a name="l00096"></a>00096 } <span class="keywordflow">else</span> {
<a name="l00097"></a>00097 <span class="comment">// Did not get an acknowledgement from the RTC chip.</span>
<a name="l00098"></a>00098 _isRealTime = <span class="keyword">false</span>;
<a name="l00099"></a>00099 }
<a name="l00100"></a>00100
<a name="l00101"></a>00101 <span class="comment">// Turn on the 1 Hz square wave signal if required.</span>
<a name="l00102"></a>00102 <span class="keywordflow">if</span> (oneHzPin != 255 &amp;&amp; _isRealTime) {
<a name="l00103"></a>00103 pinMode(oneHzPin, INPUT);
<a name="l00104"></a>00104 digitalWrite(oneHzPin, HIGH);
<a name="l00105"></a>00105 writeRegister(DS1307_CONTROL, 0x10);
<a name="l00106"></a>00106 }
<a name="l00107"></a>00107
<a name="l00108"></a>00108 <span class="comment">// Initialize the alarms in the RTC chip&#39;s NVRAM.</span>
<a name="l00109"></a>00109 <span class="keywordflow">if</span> (_isRealTime)
<a name="l00110"></a>00110 initAlarms();
<a name="l00111"></a>00111 }
<a name="l00112"></a>00112
<a name="l00118"></a><a class="code" href="classDS1307RTC.html#a6fec8ff71f33cc1a129eb0bd009600b0">00118</a> <span class="keywordtype">bool</span> <a class="code" href="classDS1307RTC.html#a6fec8ff71f33cc1a129eb0bd009600b0" title="Returns true if the realtime clock has updated since the last call to this function.">DS1307RTC::hasUpdates</a>()
<a name="l00119"></a>00119 {
<a name="l00120"></a>00120 <span class="comment">// If not using a 1 Hz pin or there is no RTC chip available,</span>
<a name="l00121"></a>00121 <span class="comment">// then assume that there is an update available.</span>
<a name="l00122"></a>00122 <span class="keywordflow">if</span> (_oneHzPin == 255 || !_isRealTime)
<a name="l00123"></a>00123 <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00124"></a>00124
<a name="l00125"></a>00125 <span class="comment">// The DS1307 updates the internal registers on the falling edge of the</span>
<a name="l00126"></a>00126 <span class="comment">// 1 Hz clock. The values should be ready to read on the rising edge.</span>
<a name="l00127"></a>00127 <span class="keywordtype">bool</span> value = digitalRead(_oneHzPin);
<a name="l00128"></a>00128 <span class="keywordflow">if</span> (value &amp;&amp; !prevOneHz) {
<a name="l00129"></a>00129 prevOneHz = value;
<a name="l00130"></a>00130 <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00131"></a>00131 } <span class="keywordflow">else</span> {
<a name="l00132"></a>00132 prevOneHz = value;
<a name="l00133"></a>00133 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00134"></a>00134 }
<a name="l00135"></a>00135 }
<a name="l00136"></a>00136
<a name="l00137"></a>00137 <span class="keyword">inline</span> uint8_t fromBCD(uint8_t value)
<a name="l00138"></a>00138 {
<a name="l00139"></a>00139 <span class="keywordflow">return</span> (value &gt;&gt; 4) * 10 + (value &amp; 0x0F);
<a name="l00140"></a>00140 }
<a name="l00141"></a>00141
<a name="l00142"></a>00142 <span class="keyword">inline</span> uint8_t fromHourBCD(uint8_t value)
<a name="l00143"></a>00143 {
<a name="l00144"></a>00144 <span class="keywordflow">if</span> ((value &amp; 0x40) != 0) {
<a name="l00145"></a>00145 <span class="comment">// 12-hour mode.</span>
<a name="l00146"></a>00146 uint8_t result = ((value &gt;&gt; 4) &amp; 0x01) * 10 + (value &amp; 0x0F);
<a name="l00147"></a>00147 <span class="keywordflow">if</span> ((value &amp; 0x20) != 0)
<a name="l00148"></a>00148 <span class="keywordflow">return</span> (result == 12) ? 12 : (result + 12); <span class="comment">// PM</span>
<a name="l00149"></a>00149 <span class="keywordflow">else</span>
<a name="l00150"></a>00150 <span class="keywordflow">return</span> (result == 12) ? 0 : result; <span class="comment">// AM</span>
<a name="l00151"></a>00151 } <span class="keywordflow">else</span> {
<a name="l00152"></a>00152 <span class="comment">// 24-hour mode.</span>
<a name="l00153"></a>00153 <span class="keywordflow">return</span> fromBCD(value);
<a name="l00154"></a>00154 }
<a name="l00155"></a>00155 }
<a name="l00156"></a>00156
<a name="l00157"></a><a class="code" href="classDS1307RTC.html#acd9800d6df2244b8e4e790480a1d62a6">00157</a> <span class="keywordtype">void</span> <a class="code" href="classDS1307RTC.html#acd9800d6df2244b8e4e790480a1d62a6" title="Reads the current time from the realtime clock into value.">DS1307RTC::readTime</a>(<a class="code" href="structRTCTime.html" title="Stores time information from a realtime clock chip.">RTCTime</a> *value)
<a name="l00158"></a>00158 {
<a name="l00159"></a>00159 <span class="keywordflow">if</span> (_isRealTime) {
<a name="l00160"></a>00160 _bus-&gt;<a class="code" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite</a>(DS1307_I2C_ADDRESS);
<a name="l00161"></a>00161 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(DS1307_SECOND);
<a name="l00162"></a>00162 <span class="keywordflow">if</span> (_bus-&gt;<a class="code" href="classI2CMaster.html#a4e5f1a1a4c2242699be5a35fc4872fde" title="Starts a read operation for count bytes by sending the start condition and the I2C control byte...">startRead</a>(DS1307_I2C_ADDRESS, 3)) {
<a name="l00163"></a>00163 value-&gt;<a class="code" href="structRTCTime.html#a87b7c02e535d808dcba04c77e34abb91" title="Second within the minute (0-59)">second</a> = fromBCD(_bus-&gt;<a class="code" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd" title="Reads a single byte from the I2C bus.">read</a>() &amp; 0x7F);
<a name="l00164"></a>00164 value-&gt;<a class="code" href="structRTCTime.html#acf2161ca037080dc4b767e636ad8db84" title="Minute within the hour (0-59)">minute</a> = fromBCD(_bus-&gt;<a class="code" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd" title="Reads a single byte from the I2C bus.">read</a>());
<a name="l00165"></a>00165 value-&gt;<a class="code" href="structRTCTime.html#a98ba717092ef856dd2b773ba02fcb1a4" title="Hour of the day (0-23)">hour</a> = fromHourBCD(_bus-&gt;<a class="code" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd" title="Reads a single byte from the I2C bus.">read</a>());
<a name="l00166"></a>00166 } <span class="keywordflow">else</span> {
<a name="l00167"></a>00167 <span class="comment">// RTC chip is not responding.</span>
<a name="l00168"></a>00168 value-&gt;<a class="code" href="structRTCTime.html#a87b7c02e535d808dcba04c77e34abb91" title="Second within the minute (0-59)">second</a> = 0;
<a name="l00169"></a>00169 value-&gt;<a class="code" href="structRTCTime.html#acf2161ca037080dc4b767e636ad8db84" title="Minute within the hour (0-59)">minute</a> = 0;
<a name="l00170"></a>00170 value-&gt;<a class="code" href="structRTCTime.html#a98ba717092ef856dd2b773ba02fcb1a4" title="Hour of the day (0-23)">hour</a> = 0;
<a name="l00171"></a>00171 }
<a name="l00172"></a>00172 } <span class="keywordflow">else</span> {
<a name="l00173"></a>00173 <a class="code" href="classDS1307RTC.html#acd9800d6df2244b8e4e790480a1d62a6" title="Reads the current time from the realtime clock into value.">RTC::readTime</a>(value);
<a name="l00174"></a>00174 }
<a name="l00175"></a>00175 }
<a name="l00176"></a>00176
<a name="l00177"></a><a class="code" href="classDS1307RTC.html#a6fb56d1690bc30e7995961a5b5e5fdc4">00177</a> <span class="keywordtype">void</span> <a class="code" href="classDS1307RTC.html#a6fb56d1690bc30e7995961a5b5e5fdc4" title="Reads the current date from the realtime clock into value.">DS1307RTC::readDate</a>(<a class="code" href="structRTCDate.html" title="Stores date information from a realtime clock chip.">RTCDate</a> *value)
<a name="l00178"></a>00178 {
<a name="l00179"></a>00179 <span class="keywordflow">if</span> (!_isRealTime) {
<a name="l00180"></a>00180 <a class="code" href="classDS1307RTC.html#a6fb56d1690bc30e7995961a5b5e5fdc4" title="Reads the current date from the realtime clock into value.">RTC::readDate</a>(value);
<a name="l00181"></a>00181 <span class="keywordflow">return</span>;
<a name="l00182"></a>00182 }
<a name="l00183"></a>00183 _bus-&gt;<a class="code" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite</a>(DS1307_I2C_ADDRESS);
<a name="l00184"></a>00184 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(DS1307_DATE);
<a name="l00185"></a>00185 <span class="keywordflow">if</span> (_bus-&gt;<a class="code" href="classI2CMaster.html#a4e5f1a1a4c2242699be5a35fc4872fde" title="Starts a read operation for count bytes by sending the start condition and the I2C control byte...">startRead</a>(DS1307_I2C_ADDRESS, 3)) {
<a name="l00186"></a>00186 value-&gt;<a class="code" href="structRTCDate.html#a2d68ff3fb90240df522b41222362704c" title="Day of the month (1-31)">day</a> = fromBCD(_bus-&gt;<a class="code" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd" title="Reads a single byte from the I2C bus.">read</a>());
<a name="l00187"></a>00187 value-&gt;<a class="code" href="structRTCDate.html#a6e6196059b36186041a5312400ea9202" title="Month of the year (1-12)">month</a> = fromBCD(_bus-&gt;<a class="code" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd" title="Reads a single byte from the I2C bus.">read</a>());
<a name="l00188"></a>00188 value-&gt;<a class="code" href="structRTCDate.html#a7d31822daff3c3fc947386abd897732f" title="Year (4-digit)">year</a> = fromBCD(_bus-&gt;<a class="code" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd" title="Reads a single byte from the I2C bus.">read</a>()) + 2000;
<a name="l00189"></a>00189 } <span class="keywordflow">else</span> {
<a name="l00190"></a>00190 <span class="comment">// RTC chip is not responding.</span>
<a name="l00191"></a>00191 value-&gt;<a class="code" href="structRTCDate.html#a2d68ff3fb90240df522b41222362704c" title="Day of the month (1-31)">day</a> = 1;
<a name="l00192"></a>00192 value-&gt;<a class="code" href="structRTCDate.html#a6e6196059b36186041a5312400ea9202" title="Month of the year (1-12)">month</a> = 1;
<a name="l00193"></a>00193 value-&gt;<a class="code" href="structRTCDate.html#a7d31822daff3c3fc947386abd897732f" title="Year (4-digit)">year</a> = 2000;
<a name="l00194"></a>00194 }
<a name="l00195"></a>00195 }
<a name="l00196"></a>00196
<a name="l00197"></a>00197 <span class="keyword">inline</span> uint8_t toBCD(uint8_t value)
<a name="l00198"></a>00198 {
<a name="l00199"></a>00199 <span class="keywordflow">return</span> ((value / 10) &lt;&lt; 4) + (value % 10);
<a name="l00200"></a>00200 }
<a name="l00201"></a>00201
<a name="l00202"></a><a class="code" href="classDS1307RTC.html#a0a5d0d86a0345420ebb289ea724b19e8">00202</a> <span class="keywordtype">void</span> <a class="code" href="classDS1307RTC.html#a0a5d0d86a0345420ebb289ea724b19e8" title="Updates the time in the realtime clock to match value.">DS1307RTC::writeTime</a>(<span class="keyword">const</span> <a class="code" href="structRTCTime.html" title="Stores time information from a realtime clock chip.">RTCTime</a> *value)
<a name="l00203"></a>00203 {
<a name="l00204"></a>00204 <span class="keywordflow">if</span> (_isRealTime) {
<a name="l00205"></a>00205 _bus-&gt;<a class="code" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite</a>(DS1307_I2C_ADDRESS);
<a name="l00206"></a>00206 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(DS1307_SECOND);
<a name="l00207"></a>00207 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(toBCD(value-&gt;<a class="code" href="structRTCTime.html#a87b7c02e535d808dcba04c77e34abb91" title="Second within the minute (0-59)">second</a>));
<a name="l00208"></a>00208 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(toBCD(value-&gt;<a class="code" href="structRTCTime.html#acf2161ca037080dc4b767e636ad8db84" title="Minute within the hour (0-59)">minute</a>));
<a name="l00209"></a>00209 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(toBCD(value-&gt;<a class="code" href="structRTCTime.html#a98ba717092ef856dd2b773ba02fcb1a4" title="Hour of the day (0-23)">hour</a>)); <span class="comment">// Changes mode to 24-hour clock.</span>
<a name="l00210"></a>00210 _bus-&gt;<a class="code" href="classI2CMaster.html#ab29f63551ddeb032a91505d1c0b8ac41" title="Ends the current write operation.">endWrite</a>();
<a name="l00211"></a>00211 } <span class="keywordflow">else</span> {
<a name="l00212"></a>00212 <a class="code" href="classDS1307RTC.html#a0a5d0d86a0345420ebb289ea724b19e8" title="Updates the time in the realtime clock to match value.">RTC::writeTime</a>(value);
<a name="l00213"></a>00213 }
<a name="l00214"></a>00214 }
<a name="l00215"></a>00215
<a name="l00216"></a><a class="code" href="classDS1307RTC.html#a4f7346be33612cf9ecd96080eb046230">00216</a> <span class="keywordtype">void</span> <a class="code" href="classDS1307RTC.html#a4f7346be33612cf9ecd96080eb046230" title="Updates the date in the realtime clock to match value.">DS1307RTC::writeDate</a>(<span class="keyword">const</span> <a class="code" href="structRTCDate.html" title="Stores date information from a realtime clock chip.">RTCDate</a> *value)
<a name="l00217"></a>00217 {
<a name="l00218"></a>00218 <span class="keywordflow">if</span> (_isRealTime) {
<a name="l00219"></a>00219 _bus-&gt;<a class="code" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite</a>(DS1307_I2C_ADDRESS);
<a name="l00220"></a>00220 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(DS1307_DATE);
<a name="l00221"></a>00221 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(toBCD(value-&gt;<a class="code" href="structRTCDate.html#a2d68ff3fb90240df522b41222362704c" title="Day of the month (1-31)">day</a>));
<a name="l00222"></a>00222 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(toBCD(value-&gt;<a class="code" href="structRTCDate.html#a6e6196059b36186041a5312400ea9202" title="Month of the year (1-12)">month</a>));
<a name="l00223"></a>00223 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(toBCD(value-&gt;<a class="code" href="structRTCDate.html#a7d31822daff3c3fc947386abd897732f" title="Year (4-digit)">year</a> % 100));
<a name="l00224"></a>00224 _bus-&gt;<a class="code" href="classI2CMaster.html#ab29f63551ddeb032a91505d1c0b8ac41" title="Ends the current write operation.">endWrite</a>();
<a name="l00225"></a>00225 } <span class="keywordflow">else</span> {
<a name="l00226"></a>00226 <a class="code" href="classDS1307RTC.html#a4f7346be33612cf9ecd96080eb046230" title="Updates the date in the realtime clock to match value.">RTC::writeDate</a>(value);
<a name="l00227"></a>00227 }
<a name="l00228"></a>00228 }
<a name="l00229"></a>00229
<a name="l00230"></a><a class="code" href="classDS1307RTC.html#aab608eb1630520ee122306b721fdc47a">00230</a> <span class="keywordtype">void</span> <a class="code" href="classDS1307RTC.html#aab608eb1630520ee122306b721fdc47a" title="Reads the details of the alarm with index alarmNum into value.">DS1307RTC::readAlarm</a>(uint8_t alarmNum, <a class="code" href="structRTCAlarm.html" title="Stores alarm information from a realtime clock chip.">RTCAlarm</a> *value)
<a name="l00231"></a>00231 {
<a name="l00232"></a>00232 <span class="keywordflow">if</span> (_isRealTime) {
<a name="l00233"></a>00233 _bus-&gt;<a class="code" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite</a>(DS1307_I2C_ADDRESS);
<a name="l00234"></a>00234 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(DS1307_ALARMS + alarmNum * DS1307_ALARM_SIZE);
<a name="l00235"></a>00235 <span class="keywordflow">if</span> (_bus-&gt;<a class="code" href="classI2CMaster.html#a4e5f1a1a4c2242699be5a35fc4872fde" title="Starts a read operation for count bytes by sending the start condition and the I2C control byte...">startRead</a>(DS1307_I2C_ADDRESS, 3)) {
<a name="l00236"></a>00236 value-&gt;<a class="code" href="structRTCAlarm.html#a75bdc42acd3ab3ad495680c6b6a34692" title="Hour of the day for the alarm (0-23).">hour</a> = fromBCD(_bus-&gt;<a class="code" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd" title="Reads a single byte from the I2C bus.">read</a>());
<a name="l00237"></a>00237 value-&gt;<a class="code" href="structRTCAlarm.html#ad9a75ceb4b4b3474baa66dd5466e62fe" title="Minute of the hour for the alarm (0-59).">minute</a> = fromBCD(_bus-&gt;<a class="code" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd" title="Reads a single byte from the I2C bus.">read</a>());
<a name="l00238"></a>00238 value-&gt;<a class="code" href="structRTCAlarm.html#a0f2ef7363cb60a26642d5295b77ca19e" title="Additional flags for the alarm.">flags</a> = _bus-&gt;<a class="code" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd" title="Reads a single byte from the I2C bus.">read</a>();
<a name="l00239"></a>00239 } <span class="keywordflow">else</span> {
<a name="l00240"></a>00240 <span class="comment">// RTC chip is not responding.</span>
<a name="l00241"></a>00241 value-&gt;<a class="code" href="structRTCAlarm.html#a75bdc42acd3ab3ad495680c6b6a34692" title="Hour of the day for the alarm (0-23).">hour</a> = 0;
<a name="l00242"></a>00242 value-&gt;<a class="code" href="structRTCAlarm.html#ad9a75ceb4b4b3474baa66dd5466e62fe" title="Minute of the hour for the alarm (0-59).">minute</a> = 0;
<a name="l00243"></a>00243 value-&gt;<a class="code" href="structRTCAlarm.html#a0f2ef7363cb60a26642d5295b77ca19e" title="Additional flags for the alarm.">flags</a> = 0;
<a name="l00244"></a>00244 }
<a name="l00245"></a>00245 } <span class="keywordflow">else</span> {
<a name="l00246"></a>00246 <a class="code" href="classDS1307RTC.html#aab608eb1630520ee122306b721fdc47a" title="Reads the details of the alarm with index alarmNum into value.">RTC::readAlarm</a>(alarmNum, value);
<a name="l00247"></a>00247 }
<a name="l00248"></a>00248 }
<a name="l00249"></a>00249
<a name="l00250"></a><a class="code" href="classDS1307RTC.html#a7354aed91d7c94d0d7b2144b1bf32c75">00250</a> <span class="keywordtype">void</span> <a class="code" href="classDS1307RTC.html#a7354aed91d7c94d0d7b2144b1bf32c75" title="Updates the details of the alarm with index alarmNum from value.">DS1307RTC::writeAlarm</a>(uint8_t alarmNum, <span class="keyword">const</span> <a class="code" href="structRTCAlarm.html" title="Stores alarm information from a realtime clock chip.">RTCAlarm</a> *value)
<a name="l00251"></a>00251 {
<a name="l00252"></a>00252 <span class="keywordflow">if</span> (_isRealTime) {
<a name="l00253"></a>00253 _bus-&gt;<a class="code" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite</a>(DS1307_I2C_ADDRESS);
<a name="l00254"></a>00254 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(DS1307_ALARMS + alarmNum * DS1307_ALARM_SIZE);
<a name="l00255"></a>00255 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(toBCD(value-&gt;<a class="code" href="structRTCAlarm.html#a75bdc42acd3ab3ad495680c6b6a34692" title="Hour of the day for the alarm (0-23).">hour</a>));
<a name="l00256"></a>00256 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(toBCD(value-&gt;<a class="code" href="structRTCAlarm.html#ad9a75ceb4b4b3474baa66dd5466e62fe" title="Minute of the hour for the alarm (0-59).">minute</a>));
<a name="l00257"></a>00257 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(value-&gt;<a class="code" href="structRTCAlarm.html#a0f2ef7363cb60a26642d5295b77ca19e" title="Additional flags for the alarm.">flags</a>);
<a name="l00258"></a>00258 _bus-&gt;<a class="code" href="classI2CMaster.html#ab29f63551ddeb032a91505d1c0b8ac41" title="Ends the current write operation.">endWrite</a>();
<a name="l00259"></a>00259 } <span class="keywordflow">else</span> {
<a name="l00260"></a>00260 <a class="code" href="classDS1307RTC.html#a7354aed91d7c94d0d7b2144b1bf32c75" title="Updates the details of the alarm with index alarmNum from value.">RTC::writeAlarm</a>(alarmNum, value);
<a name="l00261"></a>00261 }
<a name="l00262"></a>00262 }
<a name="l00263"></a>00263
<a name="l00264"></a><a class="code" href="classDS1307RTC.html#a93c25269a9b78ab3331354db26672248">00264</a> <span class="keywordtype">int</span> <a class="code" href="classDS1307RTC.html#a93c25269a9b78ab3331354db26672248" title="Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings...">DS1307RTC::byteCount</a>()<span class="keyword"> const</span>
<a name="l00265"></a>00265 <span class="keyword"></span>{
<a name="l00266"></a>00266 <span class="keywordflow">return</span> DS1307_ALARMS - DS1307_NVRAM;
<a name="l00267"></a>00267 }
<a name="l00268"></a>00268
<a name="l00269"></a><a class="code" href="classDS1307RTC.html#a7364609a201022688778ab116c3e4f4a">00269</a> uint8_t <a class="code" href="classDS1307RTC.html#a7364609a201022688778ab116c3e4f4a" title="Reads the byte at offset within the realtime clock&#39;s non-volatile memory.">DS1307RTC::readByte</a>(uint8_t offset)
<a name="l00270"></a>00270 {
<a name="l00271"></a>00271 <span class="keywordflow">if</span> (_isRealTime)
<a name="l00272"></a>00272 <span class="keywordflow">return</span> readRegister(DS1307_NVRAM + offset);
<a name="l00273"></a>00273 <span class="keywordflow">else</span>
<a name="l00274"></a>00274 <span class="keywordflow">return</span> <a class="code" href="classDS1307RTC.html#a7364609a201022688778ab116c3e4f4a" title="Reads the byte at offset within the realtime clock&#39;s non-volatile memory.">RTC::readByte</a>(offset);
<a name="l00275"></a>00275 }
<a name="l00276"></a>00276
<a name="l00277"></a><a class="code" href="classDS1307RTC.html#a6ef435fd4aa4adf8eefdf8b1741f5ba6">00277</a> <span class="keywordtype">void</span> <a class="code" href="classDS1307RTC.html#a6ef435fd4aa4adf8eefdf8b1741f5ba6" title="Writes value to offset within the realtime clock&#39;s non-volatile memory.">DS1307RTC::writeByte</a>(uint8_t offset, uint8_t value)
<a name="l00278"></a>00278 {
<a name="l00279"></a>00279 <span class="keywordflow">if</span> (_isRealTime)
<a name="l00280"></a>00280 writeRegister(DS1307_NVRAM + offset, value);
<a name="l00281"></a>00281 <span class="keywordflow">else</span>
<a name="l00282"></a>00282 <a class="code" href="classDS1307RTC.html#a6ef435fd4aa4adf8eefdf8b1741f5ba6" title="Writes value to offset within the realtime clock&#39;s non-volatile memory.">RTC::writeByte</a>(offset, value);
<a name="l00283"></a>00283 }
<a name="l00284"></a>00284
<a name="l00285"></a>00285 <span class="keywordtype">void</span> DS1307RTC::initAlarms()
<a name="l00286"></a>00286 {
<a name="l00287"></a>00287 uint8_t value = readRegister(DS1307_ALARM_MAGIC);
<a name="l00288"></a>00288 <span class="keywordflow">if</span> (value != (0xB0 + <a class="code" href="classRTC.html#aee5ae8f600ee5296e65635c0d836fca3" title="Number of alarms that are supported by RTC::readAlarm() and RTC::writeAlarm().">ALARM_COUNT</a>)) {
<a name="l00289"></a>00289 <span class="comment">// This is the first time we have used this clock chip,</span>
<a name="l00290"></a>00290 <span class="comment">// so initialize all alarms to their default state.</span>
<a name="l00291"></a>00291 <a class="code" href="structRTCAlarm.html" title="Stores alarm information from a realtime clock chip.">RTCAlarm</a> alarm;
<a name="l00292"></a>00292 alarm.<a class="code" href="structRTCAlarm.html#a75bdc42acd3ab3ad495680c6b6a34692" title="Hour of the day for the alarm (0-23).">hour</a> = 6; <span class="comment">// Default to 6am for alarms.</span>
<a name="l00293"></a>00293 alarm.<a class="code" href="structRTCAlarm.html#ad9a75ceb4b4b3474baa66dd5466e62fe" title="Minute of the hour for the alarm (0-59).">minute</a> = 0;
<a name="l00294"></a>00294 alarm.<a class="code" href="structRTCAlarm.html#a0f2ef7363cb60a26642d5295b77ca19e" title="Additional flags for the alarm.">flags</a> = 0;
<a name="l00295"></a>00295 <span class="keywordflow">for</span> (uint8_t index = 0; index &lt; <a class="code" href="classRTC.html#aee5ae8f600ee5296e65635c0d836fca3" title="Number of alarms that are supported by RTC::readAlarm() and RTC::writeAlarm().">ALARM_COUNT</a>; ++index)
<a name="l00296"></a>00296 <a class="code" href="classDS1307RTC.html#a7354aed91d7c94d0d7b2144b1bf32c75" title="Updates the details of the alarm with index alarmNum from value.">writeAlarm</a>(index, &amp;alarm);
<a name="l00297"></a>00297 writeRegister(DS1307_ALARM_MAGIC, 0xB0 + ALARM_COUNT);
<a name="l00298"></a>00298
<a name="l00299"></a>00299 <span class="comment">// Also clear the rest of NVRAM so that it is in a known state.</span>
<a name="l00300"></a>00300 <span class="comment">// Otherwise we&#39;ll have whatever garbage was present at power-on.</span>
<a name="l00301"></a>00301 _bus-&gt;<a class="code" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite</a>(DS1307_I2C_ADDRESS);
<a name="l00302"></a>00302 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(DS1307_NVRAM);
<a name="l00303"></a>00303 <span class="keywordflow">for</span> (uint8_t index = DS1307_NVRAM; index &lt; DS1307_ALARMS; ++index)
<a name="l00304"></a>00304 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(0);
<a name="l00305"></a>00305 _bus-&gt;<a class="code" href="classI2CMaster.html#ab29f63551ddeb032a91505d1c0b8ac41" title="Ends the current write operation.">endWrite</a>();
<a name="l00306"></a>00306 }
<a name="l00307"></a>00307 }
<a name="l00308"></a>00308
<a name="l00309"></a>00309 uint8_t DS1307RTC::readRegister(uint8_t reg)
<a name="l00310"></a>00310 {
<a name="l00311"></a>00311 _bus-&gt;<a class="code" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite</a>(DS1307_I2C_ADDRESS);
<a name="l00312"></a>00312 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(reg);
<a name="l00313"></a>00313 <span class="keywordflow">if</span> (!_bus-&gt;<a class="code" href="classI2CMaster.html#a4e5f1a1a4c2242699be5a35fc4872fde" title="Starts a read operation for count bytes by sending the start condition and the I2C control byte...">startRead</a>(DS1307_I2C_ADDRESS, 1))
<a name="l00314"></a>00314 <span class="keywordflow">return</span> 0; <span class="comment">// RTC chip is not responding.</span>
<a name="l00315"></a>00315 <span class="keywordflow">return</span> _bus-&gt;<a class="code" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd" title="Reads a single byte from the I2C bus.">read</a>();
<a name="l00316"></a>00316 }
<a name="l00317"></a>00317
<a name="l00318"></a>00318 <span class="keywordtype">bool</span> DS1307RTC::writeRegister(uint8_t reg, uint8_t value)
<a name="l00319"></a>00319 {
<a name="l00320"></a>00320 _bus-&gt;<a class="code" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite</a>(DS1307_I2C_ADDRESS);
<a name="l00321"></a>00321 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(reg);
<a name="l00322"></a>00322 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(value);
<a name="l00323"></a>00323 <span class="keywordflow">return</span> _bus-&gt;<a class="code" href="classI2CMaster.html#ab29f63551ddeb032a91505d1c0b8ac41" title="Ends the current write operation.">endWrite</a>();
<a name="l00324"></a>00324 }
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:49 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

146
DS1307RTC_8h_source.html Normal file
View File

@ -0,0 +1,146 @@
<!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"/>
<title>ArduinoLibs: DS1307RTC.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">DS1307RTC.h</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#ifndef DS1307RTC_h</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define DS1307RTC_h</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &quot;RTC.h&quot;</span>
<a name="l00027"></a>00027
<a name="l00028"></a>00028 <span class="keyword">class </span><a class="code" href="classI2CMaster.html" title="Abstract base class for I2C master implementations.">I2CMaster</a>;
<a name="l00029"></a>00029
<a name="l00030"></a><a class="code" href="classDS1307RTC.html">00030</a> <span class="keyword">class </span><a class="code" href="classDS1307RTC.html" title="Communicates with a DS1307 realtime clock chip via I2C.">DS1307RTC</a> : <span class="keyword">public</span> <a class="code" href="classRTC.html" title="Base class for realtime clock handlers.">RTC</a> {
<a name="l00031"></a>00031 <span class="keyword">public</span>:
<a name="l00032"></a>00032 <a class="code" href="classDS1307RTC.html#a092805d75bea323dc4be062638bff866" title="Attaches to a realtime clock slave device on bus.">DS1307RTC</a>(<a class="code" href="classI2CMaster.html" title="Abstract base class for I2C master implementations.">I2CMaster</a> &amp;bus, uint8_t oneHzPin = 255);
<a name="l00033"></a>00033
<a name="l00034"></a><a class="code" href="classDS1307RTC.html#aba01ca4c2f7863b610e5dfe9146886bd">00034</a> <span class="keywordtype">bool</span> <a class="code" href="classDS1307RTC.html#aba01ca4c2f7863b610e5dfe9146886bd" title="Returns true if the realtime clock is on the I2C bus; false if the time and date are simulated...">isRealTime</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _isRealTime; }
<a name="l00035"></a>00035
<a name="l00036"></a>00036 <span class="keywordtype">bool</span> <a class="code" href="classDS1307RTC.html#a6fec8ff71f33cc1a129eb0bd009600b0" title="Returns true if the realtime clock has updated since the last call to this function.">hasUpdates</a>();
<a name="l00037"></a>00037
<a name="l00038"></a>00038 <span class="keywordtype">void</span> <a class="code" href="classDS1307RTC.html#acd9800d6df2244b8e4e790480a1d62a6" title="Reads the current time from the realtime clock into value.">readTime</a>(<a class="code" href="structRTCTime.html" title="Stores time information from a realtime clock chip.">RTCTime</a> *value);
<a name="l00039"></a>00039 <span class="keywordtype">void</span> <a class="code" href="classDS1307RTC.html#a6fb56d1690bc30e7995961a5b5e5fdc4" title="Reads the current date from the realtime clock into value.">readDate</a>(<a class="code" href="structRTCDate.html" title="Stores date information from a realtime clock chip.">RTCDate</a> *value);
<a name="l00040"></a>00040
<a name="l00041"></a>00041 <span class="keywordtype">void</span> <a class="code" href="classDS1307RTC.html#a0a5d0d86a0345420ebb289ea724b19e8" title="Updates the time in the realtime clock to match value.">writeTime</a>(<span class="keyword">const</span> <a class="code" href="structRTCTime.html" title="Stores time information from a realtime clock chip.">RTCTime</a> *value);
<a name="l00042"></a>00042 <span class="keywordtype">void</span> <a class="code" href="classDS1307RTC.html#a4f7346be33612cf9ecd96080eb046230" title="Updates the date in the realtime clock to match value.">writeDate</a>(<span class="keyword">const</span> <a class="code" href="structRTCDate.html" title="Stores date information from a realtime clock chip.">RTCDate</a> *value);
<a name="l00043"></a>00043
<a name="l00044"></a>00044 <span class="keywordtype">void</span> <a class="code" href="classDS1307RTC.html#aab608eb1630520ee122306b721fdc47a" title="Reads the details of the alarm with index alarmNum into value.">readAlarm</a>(uint8_t alarmNum, <a class="code" href="structRTCAlarm.html" title="Stores alarm information from a realtime clock chip.">RTCAlarm</a> *value);
<a name="l00045"></a>00045 <span class="keywordtype">void</span> <a class="code" href="classDS1307RTC.html#a7354aed91d7c94d0d7b2144b1bf32c75" title="Updates the details of the alarm with index alarmNum from value.">writeAlarm</a>(uint8_t alarmNum, <span class="keyword">const</span> <a class="code" href="structRTCAlarm.html" title="Stores alarm information from a realtime clock chip.">RTCAlarm</a> *value);
<a name="l00046"></a>00046
<a name="l00047"></a>00047 <span class="keywordtype">int</span> <a class="code" href="classDS1307RTC.html#a93c25269a9b78ab3331354db26672248" title="Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings...">byteCount</a>() <span class="keyword">const</span>;
<a name="l00048"></a>00048 uint8_t <a class="code" href="classDS1307RTC.html#a7364609a201022688778ab116c3e4f4a" title="Reads the byte at offset within the realtime clock&#39;s non-volatile memory.">readByte</a>(uint8_t offset);
<a name="l00049"></a>00049 <span class="keywordtype">void</span> <a class="code" href="classDS1307RTC.html#a6ef435fd4aa4adf8eefdf8b1741f5ba6" title="Writes value to offset within the realtime clock&#39;s non-volatile memory.">writeByte</a>(uint8_t offset, uint8_t value);
<a name="l00050"></a>00050
<a name="l00051"></a>00051 <span class="keyword">private</span>:
<a name="l00052"></a>00052 <a class="code" href="classI2CMaster.html" title="Abstract base class for I2C master implementations.">I2CMaster</a> *_bus;
<a name="l00053"></a>00053 uint8_t _oneHzPin;
<a name="l00054"></a>00054 <span class="keywordtype">bool</span> prevOneHz;
<a name="l00055"></a>00055 <span class="keywordtype">bool</span> _isRealTime;
<a name="l00056"></a>00056
<a name="l00057"></a>00057 <span class="keywordtype">void</span> initAlarms();
<a name="l00058"></a>00058
<a name="l00059"></a>00059 uint8_t readRegister(uint8_t reg);
<a name="l00060"></a>00060 <span class="keywordtype">bool</span> writeRegister(uint8_t reg, uint8_t value);
<a name="l00061"></a>00061 };
<a name="l00062"></a>00062
<a name="l00063"></a>00063 <span class="preprocessor">#endif</span>
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:49 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

512
DS3232RTC_8cpp_source.html Normal file
View File

@ -0,0 +1,512 @@
<!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"/>
<title>ArduinoLibs: DS3232RTC.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">DS3232RTC.cpp</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;DS3232RTC.h&quot;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &quot;../I2C/I2CMaster.h&quot;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#if defined(ARDUINO) &amp;&amp; ARDUINO &gt;= 100</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#include &lt;Arduino.h&gt;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#else</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span><span class="preprocessor">#include &lt;WProgram.h&gt;</span>
<a name="l00029"></a>00029 <span class="preprocessor">#endif</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span>
<a name="l00059"></a>00059 <span class="comment">// I2C address of the RTC chip (7-bit).</span>
<a name="l00060"></a>00060 <span class="preprocessor">#define DS3232_I2C_ADDRESS 0x68</span>
<a name="l00061"></a>00061 <span class="preprocessor"></span>
<a name="l00062"></a>00062 <span class="comment">// Registers.</span>
<a name="l00063"></a>00063 <span class="preprocessor">#define DS3232_SECOND 0x00</span>
<a name="l00064"></a>00064 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_MINUTE 0x01</span>
<a name="l00065"></a>00065 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_HOUR 0x02</span>
<a name="l00066"></a>00066 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_DAY_OF_WEEK 0x03</span>
<a name="l00067"></a>00067 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_DATE 0x04</span>
<a name="l00068"></a>00068 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_MONTH 0x05</span>
<a name="l00069"></a>00069 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_YEAR 0x06</span>
<a name="l00070"></a>00070 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_ALARM1_SEC 0x07</span>
<a name="l00071"></a>00071 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_ALARM1_MIN 0x08</span>
<a name="l00072"></a>00072 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_ALARM1_HOUR 0x09</span>
<a name="l00073"></a>00073 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_ALARM1_DAY 0x0A</span>
<a name="l00074"></a>00074 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_ALARM2_MIN 0x0B</span>
<a name="l00075"></a>00075 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_ALARM2_HOUR 0x0C</span>
<a name="l00076"></a>00076 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_ALARM2_DAY 0x0D</span>
<a name="l00077"></a>00077 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_CONTROL 0x0E</span>
<a name="l00078"></a>00078 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_STATUS 0x0F</span>
<a name="l00079"></a>00079 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_AGING_OFFSET 0x10</span>
<a name="l00080"></a>00080 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_TEMP_MSB 0x11</span>
<a name="l00081"></a>00081 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_TEMP_LSB 0x12</span>
<a name="l00082"></a>00082 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_RESERVED 0x13</span>
<a name="l00083"></a>00083 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_NVRAM 0x14</span>
<a name="l00084"></a>00084 <span class="preprocessor"></span>
<a name="l00085"></a>00085 <span class="comment">// Bits in the DS3232_CONTROL register.</span>
<a name="l00086"></a>00086 <span class="preprocessor">#define DS3232_EOSC 0x80</span>
<a name="l00087"></a>00087 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_BBSQW 0x40</span>
<a name="l00088"></a>00088 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_CONV 0x20</span>
<a name="l00089"></a>00089 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_RS_1HZ 0x00</span>
<a name="l00090"></a>00090 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_RS_1024HZ 0x08</span>
<a name="l00091"></a>00091 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_RS_4096HZ 0x10</span>
<a name="l00092"></a>00092 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_RS_8192HZ 0x18</span>
<a name="l00093"></a>00093 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_INTCN 0x04</span>
<a name="l00094"></a>00094 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_A2IE 0x02</span>
<a name="l00095"></a>00095 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_A1IE 0x01</span>
<a name="l00096"></a>00096 <span class="preprocessor"></span>
<a name="l00097"></a>00097 <span class="comment">// Bits in the DS3232_STATUS register.</span>
<a name="l00098"></a>00098 <span class="preprocessor">#define DS3232_OSF 0x80</span>
<a name="l00099"></a>00099 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_BB32KHZ 0x40</span>
<a name="l00100"></a>00100 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_CRATE_64 0x00</span>
<a name="l00101"></a>00101 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_CRATE_128 0x10</span>
<a name="l00102"></a>00102 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_CRATE_256 0x20</span>
<a name="l00103"></a>00103 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_CRATE_512 0x30</span>
<a name="l00104"></a>00104 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_EN32KHZ 0x08</span>
<a name="l00105"></a>00105 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_BSY 0x04</span>
<a name="l00106"></a>00106 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_A2F 0x02</span>
<a name="l00107"></a>00107 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_A1F 0x01</span>
<a name="l00108"></a>00108 <span class="preprocessor"></span>
<a name="l00109"></a>00109 <span class="comment">// Alarm storage at the end of the RTC&#39;s NVRAM.</span>
<a name="l00110"></a>00110 <span class="preprocessor">#define DS3232_ALARM_SIZE 3</span>
<a name="l00111"></a>00111 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_ALARMS (256 - RTC::ALARM_COUNT * DS3232_ALARM_SIZE - 1)</span>
<a name="l00112"></a>00112 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_ALARM_MAGIC 255</span>
<a name="l00113"></a>00113 <span class="preprocessor"></span>
<a name="l00126"></a><a class="code" href="classDS3232RTC.html#aa959454ae01b11c48d6ec7ec192b4ccb">00126</a> <a class="code" href="classDS3232RTC.html#aa959454ae01b11c48d6ec7ec192b4ccb" title="Attaches to a realtime clock slave device on bus.">DS3232RTC::DS3232RTC</a>(<a class="code" href="classI2CMaster.html" title="Abstract base class for I2C master implementations.">I2CMaster</a> &amp;bus, uint8_t oneHzPin)
<a name="l00127"></a>00127 : _bus(&amp;bus)
<a name="l00128"></a>00128 , _oneHzPin(oneHzPin)
<a name="l00129"></a>00129 , prevOneHz(false)
<a name="l00130"></a>00130 , _isRealTime(true)
<a name="l00131"></a>00131 , alarmInterrupts(false)
<a name="l00132"></a>00132 {
<a name="l00133"></a>00133 <span class="comment">// Probe the device and configure it for our use.</span>
<a name="l00134"></a>00134 _bus-&gt;<a class="code" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite</a>(DS3232_I2C_ADDRESS);
<a name="l00135"></a>00135 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(DS3232_CONTROL);
<a name="l00136"></a>00136 <span class="keywordflow">if</span> (_bus-&gt;<a class="code" href="classI2CMaster.html#a4e5f1a1a4c2242699be5a35fc4872fde" title="Starts a read operation for count bytes by sending the start condition and the I2C control byte...">startRead</a>(DS3232_I2C_ADDRESS, 1)) {
<a name="l00137"></a>00137 uint8_t value = _bus-&gt;<a class="code" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd" title="Reads a single byte from the I2C bus.">read</a>() &amp; DS3232_CONV;
<a name="l00138"></a>00138 <span class="keywordflow">if</span> (oneHzPin != 255)
<a name="l00139"></a>00139 value |= DS3232_BBSQW | DS3232_RS_1HZ;
<a name="l00140"></a>00140 _bus-&gt;<a class="code" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite</a>(DS3232_I2C_ADDRESS);
<a name="l00141"></a>00141 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(DS3232_CONTROL);
<a name="l00142"></a>00142 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(value);
<a name="l00143"></a>00143 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(DS3232_CRATE_64);
<a name="l00144"></a>00144 _bus-&gt;<a class="code" href="classI2CMaster.html#ab29f63551ddeb032a91505d1c0b8ac41" title="Ends the current write operation.">endWrite</a>();
<a name="l00145"></a>00145 } <span class="keywordflow">else</span> {
<a name="l00146"></a>00146 <span class="comment">// Did not get an acknowledgement from the RTC chip.</span>
<a name="l00147"></a>00147 _isRealTime = <span class="keyword">false</span>;
<a name="l00148"></a>00148 }
<a name="l00149"></a>00149
<a name="l00150"></a>00150 <span class="comment">// Configure the 1 Hz square wave pin if required.</span>
<a name="l00151"></a>00151 <span class="keywordflow">if</span> (oneHzPin != 255 &amp;&amp; _isRealTime) {
<a name="l00152"></a>00152 pinMode(oneHzPin, INPUT);
<a name="l00153"></a>00153 digitalWrite(oneHzPin, HIGH);
<a name="l00154"></a>00154 }
<a name="l00155"></a>00155
<a name="l00156"></a>00156 <span class="comment">// Initialize the alarms in the RTC chip&#39;s NVRAM.</span>
<a name="l00157"></a>00157 <span class="keywordflow">if</span> (_isRealTime)
<a name="l00158"></a>00158 initAlarms();
<a name="l00159"></a>00159 }
<a name="l00160"></a>00160
<a name="l00166"></a><a class="code" href="classDS3232RTC.html#a619ffee1bc013c9ddf4ae415115798bc">00166</a> <span class="keywordtype">bool</span> <a class="code" href="classDS3232RTC.html#a619ffee1bc013c9ddf4ae415115798bc" title="Returns true if the realtime clock has updated since the last call to this function.">DS3232RTC::hasUpdates</a>()
<a name="l00167"></a>00167 {
<a name="l00168"></a>00168 <span class="comment">// If not using a 1 Hz pin or there is no RTC chip available,</span>
<a name="l00169"></a>00169 <span class="comment">// then assume that there is an update available.</span>
<a name="l00170"></a>00170 <span class="keywordflow">if</span> (_oneHzPin == 255 || !_isRealTime)
<a name="l00171"></a>00171 <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00172"></a>00172
<a name="l00173"></a>00173 <span class="comment">// The DS3232 updates the internal registers on the falling edge of the</span>
<a name="l00174"></a>00174 <span class="comment">// 1 Hz clock. The values should be ready to read on the rising edge.</span>
<a name="l00175"></a>00175 <span class="keywordtype">bool</span> value = digitalRead(_oneHzPin);
<a name="l00176"></a>00176 <span class="keywordflow">if</span> (value &amp;&amp; !prevOneHz) {
<a name="l00177"></a>00177 prevOneHz = value;
<a name="l00178"></a>00178 <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00179"></a>00179 } <span class="keywordflow">else</span> {
<a name="l00180"></a>00180 prevOneHz = value;
<a name="l00181"></a>00181 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00182"></a>00182 }
<a name="l00183"></a>00183 }
<a name="l00184"></a>00184
<a name="l00185"></a>00185 <span class="keyword">inline</span> uint8_t fromBCD(uint8_t value)
<a name="l00186"></a>00186 {
<a name="l00187"></a>00187 <span class="keywordflow">return</span> (value &gt;&gt; 4) * 10 + (value &amp; 0x0F);
<a name="l00188"></a>00188 }
<a name="l00189"></a>00189
<a name="l00190"></a>00190 <span class="keyword">inline</span> uint8_t fromHourBCD(uint8_t value)
<a name="l00191"></a>00191 {
<a name="l00192"></a>00192 <span class="keywordflow">if</span> ((value &amp; 0x40) != 0) {
<a name="l00193"></a>00193 <span class="comment">// 12-hour mode.</span>
<a name="l00194"></a>00194 uint8_t result = ((value &gt;&gt; 4) &amp; 0x01) * 10 + (value &amp; 0x0F);
<a name="l00195"></a>00195 <span class="keywordflow">if</span> ((value &amp; 0x20) != 0)
<a name="l00196"></a>00196 <span class="keywordflow">return</span> (result == 12) ? 12 : (result + 12); <span class="comment">// PM</span>
<a name="l00197"></a>00197 <span class="keywordflow">else</span>
<a name="l00198"></a>00198 <span class="keywordflow">return</span> (result == 12) ? 0 : result; <span class="comment">// AM</span>
<a name="l00199"></a>00199 } <span class="keywordflow">else</span> {
<a name="l00200"></a>00200 <span class="comment">// 24-hour mode.</span>
<a name="l00201"></a>00201 <span class="keywordflow">return</span> fromBCD(value);
<a name="l00202"></a>00202 }
<a name="l00203"></a>00203 }
<a name="l00204"></a>00204
<a name="l00205"></a><a class="code" href="classDS3232RTC.html#af89e68c68f1c4b7e94286f800b5b2747">00205</a> <span class="keywordtype">void</span> <a class="code" href="classDS3232RTC.html#af89e68c68f1c4b7e94286f800b5b2747" title="Reads the current time from the realtime clock into value.">DS3232RTC::readTime</a>(<a class="code" href="structRTCTime.html" title="Stores time information from a realtime clock chip.">RTCTime</a> *value)
<a name="l00206"></a>00206 {
<a name="l00207"></a>00207 <span class="keywordflow">if</span> (_isRealTime) {
<a name="l00208"></a>00208 _bus-&gt;<a class="code" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite</a>(DS3232_I2C_ADDRESS);
<a name="l00209"></a>00209 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(DS3232_SECOND);
<a name="l00210"></a>00210 <span class="keywordflow">if</span> (_bus-&gt;<a class="code" href="classI2CMaster.html#a4e5f1a1a4c2242699be5a35fc4872fde" title="Starts a read operation for count bytes by sending the start condition and the I2C control byte...">startRead</a>(DS3232_I2C_ADDRESS, 3)) {
<a name="l00211"></a>00211 value-&gt;<a class="code" href="structRTCTime.html#a87b7c02e535d808dcba04c77e34abb91" title="Second within the minute (0-59)">second</a> = fromBCD(_bus-&gt;<a class="code" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd" title="Reads a single byte from the I2C bus.">read</a>());
<a name="l00212"></a>00212 value-&gt;<a class="code" href="structRTCTime.html#acf2161ca037080dc4b767e636ad8db84" title="Minute within the hour (0-59)">minute</a> = fromBCD(_bus-&gt;<a class="code" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd" title="Reads a single byte from the I2C bus.">read</a>());
<a name="l00213"></a>00213 value-&gt;<a class="code" href="structRTCTime.html#a98ba717092ef856dd2b773ba02fcb1a4" title="Hour of the day (0-23)">hour</a> = fromHourBCD(_bus-&gt;<a class="code" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd" title="Reads a single byte from the I2C bus.">read</a>());
<a name="l00214"></a>00214 } <span class="keywordflow">else</span> {
<a name="l00215"></a>00215 <span class="comment">// RTC chip is not responding.</span>
<a name="l00216"></a>00216 value-&gt;<a class="code" href="structRTCTime.html#a87b7c02e535d808dcba04c77e34abb91" title="Second within the minute (0-59)">second</a> = 0;
<a name="l00217"></a>00217 value-&gt;<a class="code" href="structRTCTime.html#acf2161ca037080dc4b767e636ad8db84" title="Minute within the hour (0-59)">minute</a> = 0;
<a name="l00218"></a>00218 value-&gt;<a class="code" href="structRTCTime.html#a98ba717092ef856dd2b773ba02fcb1a4" title="Hour of the day (0-23)">hour</a> = 0;
<a name="l00219"></a>00219 }
<a name="l00220"></a>00220 } <span class="keywordflow">else</span> {
<a name="l00221"></a>00221 <a class="code" href="classDS3232RTC.html#af89e68c68f1c4b7e94286f800b5b2747" title="Reads the current time from the realtime clock into value.">RTC::readTime</a>(value);
<a name="l00222"></a>00222 }
<a name="l00223"></a>00223 }
<a name="l00224"></a>00224
<a name="l00225"></a><a class="code" href="classDS3232RTC.html#ab03358e3b5996e38d766e2f9f6ab62ca">00225</a> <span class="keywordtype">void</span> <a class="code" href="classDS3232RTC.html#ab03358e3b5996e38d766e2f9f6ab62ca" title="Reads the current date from the realtime clock into value.">DS3232RTC::readDate</a>(<a class="code" href="structRTCDate.html" title="Stores date information from a realtime clock chip.">RTCDate</a> *value)
<a name="l00226"></a>00226 {
<a name="l00227"></a>00227 <span class="keywordflow">if</span> (!_isRealTime) {
<a name="l00228"></a>00228 <a class="code" href="classDS3232RTC.html#ab03358e3b5996e38d766e2f9f6ab62ca" title="Reads the current date from the realtime clock into value.">RTC::readDate</a>(value);
<a name="l00229"></a>00229 <span class="keywordflow">return</span>;
<a name="l00230"></a>00230 }
<a name="l00231"></a>00231 _bus-&gt;<a class="code" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite</a>(DS3232_I2C_ADDRESS);
<a name="l00232"></a>00232 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(DS3232_DATE);
<a name="l00233"></a>00233 <span class="keywordflow">if</span> (_bus-&gt;<a class="code" href="classI2CMaster.html#a4e5f1a1a4c2242699be5a35fc4872fde" title="Starts a read operation for count bytes by sending the start condition and the I2C control byte...">startRead</a>(DS3232_I2C_ADDRESS, 3)) {
<a name="l00234"></a>00234 value-&gt;<a class="code" href="structRTCDate.html#a2d68ff3fb90240df522b41222362704c" title="Day of the month (1-31)">day</a> = fromBCD(_bus-&gt;<a class="code" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd" title="Reads a single byte from the I2C bus.">read</a>());
<a name="l00235"></a>00235 value-&gt;<a class="code" href="structRTCDate.html#a6e6196059b36186041a5312400ea9202" title="Month of the year (1-12)">month</a> = fromBCD(_bus-&gt;<a class="code" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd" title="Reads a single byte from the I2C bus.">read</a>() &amp; 0x7F); <span class="comment">// Strip century bit.</span>
<a name="l00236"></a>00236 value-&gt;<a class="code" href="structRTCDate.html#a7d31822daff3c3fc947386abd897732f" title="Year (4-digit)">year</a> = fromBCD(_bus-&gt;<a class="code" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd" title="Reads a single byte from the I2C bus.">read</a>()) + 2000;
<a name="l00237"></a>00237 } <span class="keywordflow">else</span> {
<a name="l00238"></a>00238 <span class="comment">// RTC chip is not responding.</span>
<a name="l00239"></a>00239 value-&gt;<a class="code" href="structRTCDate.html#a2d68ff3fb90240df522b41222362704c" title="Day of the month (1-31)">day</a> = 1;
<a name="l00240"></a>00240 value-&gt;<a class="code" href="structRTCDate.html#a6e6196059b36186041a5312400ea9202" title="Month of the year (1-12)">month</a> = 1;
<a name="l00241"></a>00241 value-&gt;<a class="code" href="structRTCDate.html#a7d31822daff3c3fc947386abd897732f" title="Year (4-digit)">year</a> = 2000;
<a name="l00242"></a>00242 }
<a name="l00243"></a>00243 }
<a name="l00244"></a>00244
<a name="l00245"></a>00245 <span class="keyword">inline</span> uint8_t toBCD(uint8_t value)
<a name="l00246"></a>00246 {
<a name="l00247"></a>00247 <span class="keywordflow">return</span> ((value / 10) &lt;&lt; 4) + (value % 10);
<a name="l00248"></a>00248 }
<a name="l00249"></a>00249
<a name="l00250"></a><a class="code" href="classDS3232RTC.html#ab0ca13a8b80da856b37fc53b84e27c78">00250</a> <span class="keywordtype">void</span> <a class="code" href="classDS3232RTC.html#ab0ca13a8b80da856b37fc53b84e27c78" title="Updates the time in the realtime clock to match value.">DS3232RTC::writeTime</a>(<span class="keyword">const</span> <a class="code" href="structRTCTime.html" title="Stores time information from a realtime clock chip.">RTCTime</a> *value)
<a name="l00251"></a>00251 {
<a name="l00252"></a>00252 <span class="keywordflow">if</span> (_isRealTime) {
<a name="l00253"></a>00253 _bus-&gt;<a class="code" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite</a>(DS3232_I2C_ADDRESS);
<a name="l00254"></a>00254 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(DS3232_SECOND);
<a name="l00255"></a>00255 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(toBCD(value-&gt;<a class="code" href="structRTCTime.html#a87b7c02e535d808dcba04c77e34abb91" title="Second within the minute (0-59)">second</a>));
<a name="l00256"></a>00256 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(toBCD(value-&gt;<a class="code" href="structRTCTime.html#acf2161ca037080dc4b767e636ad8db84" title="Minute within the hour (0-59)">minute</a>));
<a name="l00257"></a>00257 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(toBCD(value-&gt;<a class="code" href="structRTCTime.html#a98ba717092ef856dd2b773ba02fcb1a4" title="Hour of the day (0-23)">hour</a>)); <span class="comment">// Changes mode to 24-hour clock.</span>
<a name="l00258"></a>00258 _bus-&gt;<a class="code" href="classI2CMaster.html#ab29f63551ddeb032a91505d1c0b8ac41" title="Ends the current write operation.">endWrite</a>();
<a name="l00259"></a>00259 } <span class="keywordflow">else</span> {
<a name="l00260"></a>00260 <a class="code" href="classDS3232RTC.html#ab0ca13a8b80da856b37fc53b84e27c78" title="Updates the time in the realtime clock to match value.">RTC::writeTime</a>(value);
<a name="l00261"></a>00261 }
<a name="l00262"></a>00262 }
<a name="l00263"></a>00263
<a name="l00264"></a><a class="code" href="classDS3232RTC.html#a31c004a90c724979d8267c31f2dbf5ed">00264</a> <span class="keywordtype">void</span> <a class="code" href="classDS3232RTC.html#a31c004a90c724979d8267c31f2dbf5ed" title="Updates the date in the realtime clock to match value.">DS3232RTC::writeDate</a>(<span class="keyword">const</span> <a class="code" href="structRTCDate.html" title="Stores date information from a realtime clock chip.">RTCDate</a> *value)
<a name="l00265"></a>00265 {
<a name="l00266"></a>00266 <span class="keywordflow">if</span> (_isRealTime) {
<a name="l00267"></a>00267 _bus-&gt;<a class="code" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite</a>(DS3232_I2C_ADDRESS);
<a name="l00268"></a>00268 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(DS3232_DATE);
<a name="l00269"></a>00269 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(toBCD(value-&gt;<a class="code" href="structRTCDate.html#a2d68ff3fb90240df522b41222362704c" title="Day of the month (1-31)">day</a>));
<a name="l00270"></a>00270 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(toBCD(value-&gt;<a class="code" href="structRTCDate.html#a6e6196059b36186041a5312400ea9202" title="Month of the year (1-12)">month</a>));
<a name="l00271"></a>00271 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(toBCD(value-&gt;<a class="code" href="structRTCDate.html#a7d31822daff3c3fc947386abd897732f" title="Year (4-digit)">year</a> % 100));
<a name="l00272"></a>00272 _bus-&gt;<a class="code" href="classI2CMaster.html#ab29f63551ddeb032a91505d1c0b8ac41" title="Ends the current write operation.">endWrite</a>();
<a name="l00273"></a>00273 } <span class="keywordflow">else</span> {
<a name="l00274"></a>00274 <a class="code" href="classDS3232RTC.html#a31c004a90c724979d8267c31f2dbf5ed" title="Updates the date in the realtime clock to match value.">RTC::writeDate</a>(value);
<a name="l00275"></a>00275 }
<a name="l00276"></a>00276 }
<a name="l00277"></a>00277
<a name="l00278"></a><a class="code" href="classDS3232RTC.html#a09c7073c687dcbbc423baf48074c7873">00278</a> <span class="keywordtype">void</span> <a class="code" href="classDS3232RTC.html#a09c7073c687dcbbc423baf48074c7873" title="Reads the details of the alarm with index alarmNum into value.">DS3232RTC::readAlarm</a>(uint8_t alarmNum, <a class="code" href="structRTCAlarm.html" title="Stores alarm information from a realtime clock chip.">RTCAlarm</a> *value)
<a name="l00279"></a>00279 {
<a name="l00280"></a>00280 <span class="keywordflow">if</span> (_isRealTime) {
<a name="l00281"></a>00281 _bus-&gt;<a class="code" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite</a>(DS3232_I2C_ADDRESS);
<a name="l00282"></a>00282 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(DS3232_ALARMS + alarmNum * DS3232_ALARM_SIZE);
<a name="l00283"></a>00283 <span class="keywordflow">if</span> (_bus-&gt;<a class="code" href="classI2CMaster.html#a4e5f1a1a4c2242699be5a35fc4872fde" title="Starts a read operation for count bytes by sending the start condition and the I2C control byte...">startRead</a>(DS3232_I2C_ADDRESS, 3)) {
<a name="l00284"></a>00284 value-&gt;<a class="code" href="structRTCAlarm.html#a75bdc42acd3ab3ad495680c6b6a34692" title="Hour of the day for the alarm (0-23).">hour</a> = fromBCD(_bus-&gt;<a class="code" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd" title="Reads a single byte from the I2C bus.">read</a>());
<a name="l00285"></a>00285 value-&gt;<a class="code" href="structRTCAlarm.html#ad9a75ceb4b4b3474baa66dd5466e62fe" title="Minute of the hour for the alarm (0-59).">minute</a> = fromBCD(_bus-&gt;<a class="code" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd" title="Reads a single byte from the I2C bus.">read</a>());
<a name="l00286"></a>00286 value-&gt;<a class="code" href="structRTCAlarm.html#a0f2ef7363cb60a26642d5295b77ca19e" title="Additional flags for the alarm.">flags</a> = _bus-&gt;<a class="code" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd" title="Reads a single byte from the I2C bus.">read</a>();
<a name="l00287"></a>00287 } <span class="keywordflow">else</span> {
<a name="l00288"></a>00288 <span class="comment">// RTC chip is not responding.</span>
<a name="l00289"></a>00289 value-&gt;<a class="code" href="structRTCAlarm.html#a75bdc42acd3ab3ad495680c6b6a34692" title="Hour of the day for the alarm (0-23).">hour</a> = 0;
<a name="l00290"></a>00290 value-&gt;<a class="code" href="structRTCAlarm.html#ad9a75ceb4b4b3474baa66dd5466e62fe" title="Minute of the hour for the alarm (0-59).">minute</a> = 0;
<a name="l00291"></a>00291 value-&gt;<a class="code" href="structRTCAlarm.html#a0f2ef7363cb60a26642d5295b77ca19e" title="Additional flags for the alarm.">flags</a> = 0;
<a name="l00292"></a>00292 }
<a name="l00293"></a>00293 } <span class="keywordflow">else</span> {
<a name="l00294"></a>00294 <a class="code" href="classDS3232RTC.html#a09c7073c687dcbbc423baf48074c7873" title="Reads the details of the alarm with index alarmNum into value.">RTC::readAlarm</a>(alarmNum, value);
<a name="l00295"></a>00295 }
<a name="l00296"></a>00296 }
<a name="l00297"></a>00297
<a name="l00298"></a><a class="code" href="classDS3232RTC.html#a8b0a65e0ac479aec8fad6ca3147dbe75">00298</a> <span class="keywordtype">void</span> <a class="code" href="classDS3232RTC.html#a8b0a65e0ac479aec8fad6ca3147dbe75" title="Updates the details of the alarm with index alarmNum from value.">DS3232RTC::writeAlarm</a>(uint8_t alarmNum, <span class="keyword">const</span> <a class="code" href="structRTCAlarm.html" title="Stores alarm information from a realtime clock chip.">RTCAlarm</a> *value)
<a name="l00299"></a>00299 {
<a name="l00300"></a>00300 <span class="keywordflow">if</span> (_isRealTime) {
<a name="l00301"></a>00301 <span class="comment">// Write the alarm details to NVRAM.</span>
<a name="l00302"></a>00302 _bus-&gt;<a class="code" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite</a>(DS3232_I2C_ADDRESS);
<a name="l00303"></a>00303 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(DS3232_ALARMS + alarmNum * DS3232_ALARM_SIZE);
<a name="l00304"></a>00304 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(toBCD(value-&gt;<a class="code" href="structRTCAlarm.html#a75bdc42acd3ab3ad495680c6b6a34692" title="Hour of the day for the alarm (0-23).">hour</a>));
<a name="l00305"></a>00305 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(toBCD(value-&gt;<a class="code" href="structRTCAlarm.html#ad9a75ceb4b4b3474baa66dd5466e62fe" title="Minute of the hour for the alarm (0-59).">minute</a>));
<a name="l00306"></a>00306 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(value-&gt;<a class="code" href="structRTCAlarm.html#a0f2ef7363cb60a26642d5295b77ca19e" title="Additional flags for the alarm.">flags</a>);
<a name="l00307"></a>00307 _bus-&gt;<a class="code" href="classI2CMaster.html#ab29f63551ddeb032a91505d1c0b8ac41" title="Ends the current write operation.">endWrite</a>();
<a name="l00308"></a>00308
<a name="l00309"></a>00309 <span class="comment">// Keep the DS3232&#39;s built-in alarms in sync with the first two alarms.</span>
<a name="l00310"></a>00310 <span class="keywordflow">if</span> (alarmNum == 0) {
<a name="l00311"></a>00311 _bus-&gt;<a class="code" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite</a>(DS3232_I2C_ADDRESS);
<a name="l00312"></a>00312 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(DS3232_ALARM1_SEC);
<a name="l00313"></a>00313 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(0);
<a name="l00314"></a>00314 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(toBCD(value-&gt;<a class="code" href="structRTCAlarm.html#ad9a75ceb4b4b3474baa66dd5466e62fe" title="Minute of the hour for the alarm (0-59).">minute</a>));
<a name="l00315"></a>00315 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(toBCD(value-&gt;<a class="code" href="structRTCAlarm.html#a75bdc42acd3ab3ad495680c6b6a34692" title="Hour of the day for the alarm (0-23).">hour</a>));
<a name="l00316"></a>00316 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(0x81); <span class="comment">// Match hours, mins, secs; day = 1</span>
<a name="l00317"></a>00317 _bus-&gt;<a class="code" href="classI2CMaster.html#ab29f63551ddeb032a91505d1c0b8ac41" title="Ends the current write operation.">endWrite</a>();
<a name="l00318"></a>00318 <span class="keywordflow">if</span> (alarmInterrupts)
<a name="l00319"></a>00319 updateAlarmInterrupts();
<a name="l00320"></a>00320 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (alarmNum == 1) {
<a name="l00321"></a>00321 _bus-&gt;<a class="code" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite</a>(DS3232_I2C_ADDRESS);
<a name="l00322"></a>00322 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(DS3232_ALARM2_MIN);
<a name="l00323"></a>00323 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(toBCD(value-&gt;<a class="code" href="structRTCAlarm.html#ad9a75ceb4b4b3474baa66dd5466e62fe" title="Minute of the hour for the alarm (0-59).">minute</a>));
<a name="l00324"></a>00324 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(toBCD(value-&gt;<a class="code" href="structRTCAlarm.html#a75bdc42acd3ab3ad495680c6b6a34692" title="Hour of the day for the alarm (0-23).">hour</a>));
<a name="l00325"></a>00325 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(0x81); <span class="comment">// Match hours, mins; day = 1</span>
<a name="l00326"></a>00326 _bus-&gt;<a class="code" href="classI2CMaster.html#ab29f63551ddeb032a91505d1c0b8ac41" title="Ends the current write operation.">endWrite</a>();
<a name="l00327"></a>00327 <span class="keywordflow">if</span> (alarmInterrupts)
<a name="l00328"></a>00328 updateAlarmInterrupts();
<a name="l00329"></a>00329 }
<a name="l00330"></a>00330 } <span class="keywordflow">else</span> {
<a name="l00331"></a>00331 <a class="code" href="classDS3232RTC.html#a8b0a65e0ac479aec8fad6ca3147dbe75" title="Updates the details of the alarm with index alarmNum from value.">RTC::writeAlarm</a>(alarmNum, value);
<a name="l00332"></a>00332 }
<a name="l00333"></a>00333 }
<a name="l00334"></a>00334
<a name="l00335"></a><a class="code" href="classDS3232RTC.html#a1319fe936dcb7e9d6bdf200b77a94f8e">00335</a> <span class="keywordtype">int</span> <a class="code" href="classDS3232RTC.html#a1319fe936dcb7e9d6bdf200b77a94f8e" title="Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings...">DS3232RTC::byteCount</a>()<span class="keyword"> const</span>
<a name="l00336"></a>00336 <span class="keyword"></span>{
<a name="l00337"></a>00337 <span class="keywordflow">return</span> DS3232_ALARMS - DS3232_NVRAM;
<a name="l00338"></a>00338 }
<a name="l00339"></a>00339
<a name="l00340"></a><a class="code" href="classDS3232RTC.html#a5ba83a3ef7d65d45c2f3241afdd8fef7">00340</a> uint8_t <a class="code" href="classDS3232RTC.html#a5ba83a3ef7d65d45c2f3241afdd8fef7" title="Reads the byte at offset within the realtime clock&#39;s non-volatile memory.">DS3232RTC::readByte</a>(uint8_t offset)
<a name="l00341"></a>00341 {
<a name="l00342"></a>00342 <span class="keywordflow">if</span> (_isRealTime)
<a name="l00343"></a>00343 <span class="keywordflow">return</span> readRegister(DS3232_NVRAM + offset);
<a name="l00344"></a>00344 <span class="keywordflow">else</span>
<a name="l00345"></a>00345 <span class="keywordflow">return</span> <a class="code" href="classDS3232RTC.html#a5ba83a3ef7d65d45c2f3241afdd8fef7" title="Reads the byte at offset within the realtime clock&#39;s non-volatile memory.">RTC::readByte</a>(offset);
<a name="l00346"></a>00346 }
<a name="l00347"></a>00347
<a name="l00348"></a><a class="code" href="classDS3232RTC.html#a9acebf12c5cecdd6d84e0ff9ed41765a">00348</a> <span class="keywordtype">void</span> <a class="code" href="classDS3232RTC.html#a9acebf12c5cecdd6d84e0ff9ed41765a" title="Writes value to offset within the realtime clock&#39;s non-volatile memory.">DS3232RTC::writeByte</a>(uint8_t offset, uint8_t value)
<a name="l00349"></a>00349 {
<a name="l00350"></a>00350 <span class="keywordflow">if</span> (_isRealTime)
<a name="l00351"></a>00351 writeRegister(DS3232_NVRAM + offset, value);
<a name="l00352"></a>00352 <span class="keywordflow">else</span>
<a name="l00353"></a>00353 <a class="code" href="classDS3232RTC.html#a9acebf12c5cecdd6d84e0ff9ed41765a" title="Writes value to offset within the realtime clock&#39;s non-volatile memory.">RTC::writeByte</a>(offset, value);
<a name="l00354"></a>00354 }
<a name="l00355"></a>00355
<a name="l00370"></a><a class="code" href="classDS3232RTC.html#ab91e79271a1f8e75b07bddbb04445dc9">00370</a> <span class="keywordtype">void</span> <a class="code" href="classDS3232RTC.html#ab91e79271a1f8e75b07bddbb04445dc9" title="Enables the generation of interrupts for alarms 0 and 1.">DS3232RTC::enableAlarmInterrupts</a>()
<a name="l00371"></a>00371 {
<a name="l00372"></a>00372 <span class="keywordflow">if</span> (_oneHzPin == 255 &amp;&amp; _isRealTime) {
<a name="l00373"></a>00373 updateAlarmInterrupts();
<a name="l00374"></a>00374 alarmInterrupts = <span class="keyword">true</span>;
<a name="l00375"></a>00375 }
<a name="l00376"></a>00376 }
<a name="l00377"></a>00377
<a name="l00383"></a><a class="code" href="classDS3232RTC.html#a225b8c62d617aa1b7be7d20e8a033be9">00383</a> <span class="keywordtype">void</span> <a class="code" href="classDS3232RTC.html#a225b8c62d617aa1b7be7d20e8a033be9" title="Disables the generation of interrupts for alarms 0 and 1.">DS3232RTC::disableAlarmInterrupts</a>()
<a name="l00384"></a>00384 {
<a name="l00385"></a>00385 <span class="keywordflow">if</span> (alarmInterrupts) {
<a name="l00386"></a>00386 uint8_t value = readRegister(DS3232_CONTROL);
<a name="l00387"></a>00387 value &amp;= ~(DS3232_INTCN | DS3232_A2IE | DS3232_A1IE);
<a name="l00388"></a>00388 writeRegister(DS3232_CONTROL, value);
<a name="l00389"></a>00389 alarmInterrupts = <span class="keyword">false</span>;
<a name="l00390"></a>00390 }
<a name="l00391"></a>00391 }
<a name="l00392"></a>00392
<a name="l00406"></a><a class="code" href="classDS3232RTC.html#a79649f100a4562b9c1ba7c69e85cbca3">00406</a> <span class="keywordtype">int</span> <a class="code" href="classDS3232RTC.html#a79649f100a4562b9c1ba7c69e85cbca3" title="Determines which of alarms 0 or 1 have fired since the last call.">DS3232RTC::firedAlarm</a>()
<a name="l00407"></a>00407 {
<a name="l00408"></a>00408 <span class="keywordflow">if</span> (!_isRealTime)
<a name="l00409"></a>00409 <span class="keywordflow">return</span> -1;
<a name="l00410"></a>00410 uint8_t value = readRegister(DS3232_STATUS);
<a name="l00411"></a>00411 <span class="keywordtype">int</span> alarm;
<a name="l00412"></a>00412 <span class="keywordflow">if</span> (value &amp; DS3232_A1F) {
<a name="l00413"></a>00413 <span class="keywordflow">if</span> (value &amp; DS3232_A2F)
<a name="l00414"></a>00414 alarm = 2;
<a name="l00415"></a>00415 <span class="keywordflow">else</span>
<a name="l00416"></a>00416 alarm = 0;
<a name="l00417"></a>00417 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (value &amp; DS3232_A2F) {
<a name="l00418"></a>00418 alarm = 1;
<a name="l00419"></a>00419 } <span class="keywordflow">else</span> {
<a name="l00420"></a>00420 alarm = -1;
<a name="l00421"></a>00421 }
<a name="l00422"></a>00422 <span class="keywordflow">if</span> (alarm != -1) {
<a name="l00423"></a>00423 value &amp;= ~(DS3232_A1F | DS3232_A2F);
<a name="l00424"></a>00424 writeRegister(DS3232_STATUS, value);
<a name="l00425"></a>00425 }
<a name="l00426"></a>00426 <span class="keywordflow">return</span> alarm;
<a name="l00427"></a>00427 }
<a name="l00428"></a>00428
<a name="l00434"></a><a class="code" href="classDS3232RTC.html#a3966de6f4241d86f198a8b9dd5e7e59a">00434</a> <span class="keywordtype">void</span> <a class="code" href="classDS3232RTC.html#a3966de6f4241d86f198a8b9dd5e7e59a" title="Enables the 32 kHz output on the DS3232 chip.">DS3232RTC::enable32kHzOutput</a>()
<a name="l00435"></a>00435 {
<a name="l00436"></a>00436 <span class="keywordflow">if</span> (_isRealTime) {
<a name="l00437"></a>00437 uint8_t value = readRegister(DS3232_STATUS);
<a name="l00438"></a>00438 value |= DS3232_BB32KHZ | DS3232_EN32KHZ;
<a name="l00439"></a>00439 writeRegister(DS3232_STATUS, value);
<a name="l00440"></a>00440 }
<a name="l00441"></a>00441 }
<a name="l00442"></a>00442
<a name="l00448"></a><a class="code" href="classDS3232RTC.html#ada732bae42fc2833e59ae293aa27ddcb">00448</a> <span class="keywordtype">void</span> <a class="code" href="classDS3232RTC.html#ada732bae42fc2833e59ae293aa27ddcb" title="Disables the 32 kHz output on the DS3232 chip.">DS3232RTC::disable32kHzOutput</a>()
<a name="l00449"></a>00449 {
<a name="l00450"></a>00450 <span class="keywordflow">if</span> (_isRealTime) {
<a name="l00451"></a>00451 uint8_t value = readRegister(DS3232_STATUS);
<a name="l00452"></a>00452 value &amp;= ~(DS3232_BB32KHZ | DS3232_EN32KHZ);
<a name="l00453"></a>00453 writeRegister(DS3232_STATUS, value);
<a name="l00454"></a>00454 }
<a name="l00455"></a>00455 }
<a name="l00456"></a>00456
<a name="l00457"></a>00457 <span class="keywordtype">void</span> DS3232RTC::initAlarms()
<a name="l00458"></a>00458 {
<a name="l00459"></a>00459 uint8_t value = readRegister(DS3232_ALARM_MAGIC);
<a name="l00460"></a>00460 <span class="keywordflow">if</span> (value != (0xB0 + <a class="code" href="classRTC.html#aee5ae8f600ee5296e65635c0d836fca3" title="Number of alarms that are supported by RTC::readAlarm() and RTC::writeAlarm().">ALARM_COUNT</a>)) {
<a name="l00461"></a>00461 <span class="comment">// This is the first time we have used this clock chip,</span>
<a name="l00462"></a>00462 <span class="comment">// so initialize all alarms to their default state.</span>
<a name="l00463"></a>00463 <a class="code" href="structRTCAlarm.html" title="Stores alarm information from a realtime clock chip.">RTCAlarm</a> alarm;
<a name="l00464"></a>00464 alarm.<a class="code" href="structRTCAlarm.html#a75bdc42acd3ab3ad495680c6b6a34692" title="Hour of the day for the alarm (0-23).">hour</a> = 6; <span class="comment">// Default to 6am for alarms.</span>
<a name="l00465"></a>00465 alarm.<a class="code" href="structRTCAlarm.html#ad9a75ceb4b4b3474baa66dd5466e62fe" title="Minute of the hour for the alarm (0-59).">minute</a> = 0;
<a name="l00466"></a>00466 alarm.<a class="code" href="structRTCAlarm.html#a0f2ef7363cb60a26642d5295b77ca19e" title="Additional flags for the alarm.">flags</a> = 0;
<a name="l00467"></a>00467 <span class="keywordflow">for</span> (uint8_t index = 0; index &lt; <a class="code" href="classRTC.html#aee5ae8f600ee5296e65635c0d836fca3" title="Number of alarms that are supported by RTC::readAlarm() and RTC::writeAlarm().">ALARM_COUNT</a>; ++index)
<a name="l00468"></a>00468 <a class="code" href="classDS3232RTC.html#a8b0a65e0ac479aec8fad6ca3147dbe75" title="Updates the details of the alarm with index alarmNum from value.">writeAlarm</a>(index, &amp;alarm);
<a name="l00469"></a>00469 writeRegister(DS3232_ALARM_MAGIC, 0xB0 + ALARM_COUNT);
<a name="l00470"></a>00470
<a name="l00471"></a>00471 <span class="comment">// Also clear the rest of NVRAM so that it is in a known state.</span>
<a name="l00472"></a>00472 <span class="comment">// Otherwise we&#39;ll have whatever garbage was present at power-on.</span>
<a name="l00473"></a>00473 _bus-&gt;<a class="code" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite</a>(DS3232_I2C_ADDRESS);
<a name="l00474"></a>00474 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(DS3232_NVRAM);
<a name="l00475"></a>00475 <span class="keywordflow">for</span> (uint8_t index = DS3232_NVRAM; index &lt; DS3232_ALARMS; ++index)
<a name="l00476"></a>00476 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(0);
<a name="l00477"></a>00477 _bus-&gt;<a class="code" href="classI2CMaster.html#ab29f63551ddeb032a91505d1c0b8ac41" title="Ends the current write operation.">endWrite</a>();
<a name="l00478"></a>00478 }
<a name="l00479"></a>00479 }
<a name="l00480"></a>00480
<a name="l00481"></a>00481 uint8_t DS3232RTC::readRegister(uint8_t reg)
<a name="l00482"></a>00482 {
<a name="l00483"></a>00483 _bus-&gt;<a class="code" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite</a>(DS3232_I2C_ADDRESS);
<a name="l00484"></a>00484 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(reg);
<a name="l00485"></a>00485 <span class="keywordflow">if</span> (!_bus-&gt;<a class="code" href="classI2CMaster.html#a4e5f1a1a4c2242699be5a35fc4872fde" title="Starts a read operation for count bytes by sending the start condition and the I2C control byte...">startRead</a>(DS3232_I2C_ADDRESS, 1))
<a name="l00486"></a>00486 <span class="keywordflow">return</span> 0; <span class="comment">// RTC chip is not responding.</span>
<a name="l00487"></a>00487 <span class="keywordflow">return</span> _bus-&gt;<a class="code" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd" title="Reads a single byte from the I2C bus.">read</a>();
<a name="l00488"></a>00488 }
<a name="l00489"></a>00489
<a name="l00490"></a>00490 <span class="keywordtype">bool</span> DS3232RTC::writeRegister(uint8_t reg, uint8_t value)
<a name="l00491"></a>00491 {
<a name="l00492"></a>00492 _bus-&gt;<a class="code" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite</a>(DS3232_I2C_ADDRESS);
<a name="l00493"></a>00493 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(reg);
<a name="l00494"></a>00494 _bus-&gt;<a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(value);
<a name="l00495"></a>00495 <span class="keywordflow">return</span> _bus-&gt;<a class="code" href="classI2CMaster.html#ab29f63551ddeb032a91505d1c0b8ac41" title="Ends the current write operation.">endWrite</a>();
<a name="l00496"></a>00496 }
<a name="l00497"></a>00497
<a name="l00498"></a>00498 <span class="preprocessor">#define DS3232_ALARM1_FLAGS (DS3232_ALARMS + 2)</span>
<a name="l00499"></a>00499 <span class="preprocessor"></span><span class="preprocessor">#define DS3232_ALARM2_FLAGS (DS3232_ALARMS + DS3232_ALARM_SIZE + 2)</span>
<a name="l00500"></a>00500 <span class="preprocessor"></span>
<a name="l00501"></a>00501 <span class="keywordtype">void</span> DS3232RTC::updateAlarmInterrupts()
<a name="l00502"></a>00502 {
<a name="l00503"></a>00503 <span class="keywordtype">bool</span> alarm1Enabled = ((readRegister(DS3232_ALARM1_FLAGS) &amp; 0x01) != 0);
<a name="l00504"></a>00504 <span class="keywordtype">bool</span> alarm2Enabled = ((readRegister(DS3232_ALARM2_FLAGS) &amp; 0x01) != 0);
<a name="l00505"></a>00505 uint8_t value = readRegister(DS3232_CONTROL);
<a name="l00506"></a>00506 value |= DS3232_INTCN;
<a name="l00507"></a>00507 <span class="keywordflow">if</span> (alarm1Enabled)
<a name="l00508"></a>00508 value |= DS3232_A1IE;
<a name="l00509"></a>00509 <span class="keywordflow">else</span>
<a name="l00510"></a>00510 value &amp;= ~DS3232_A1IE;
<a name="l00511"></a>00511 <span class="keywordflow">if</span> (alarm2Enabled)
<a name="l00512"></a>00512 value |= DS3232_A2IE;
<a name="l00513"></a>00513 <span class="keywordflow">else</span>
<a name="l00514"></a>00514 value &amp;= ~DS3232_A2IE;
<a name="l00515"></a>00515 writeRegister(DS3232_CONTROL, value);
<a name="l00516"></a>00516 }
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:49 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

156
DS3232RTC_8h_source.html Normal file
View File

@ -0,0 +1,156 @@
<!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"/>
<title>ArduinoLibs: DS3232RTC.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">DS3232RTC.h</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#ifndef DS3232RTC_h</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define DS3232RTC_h</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &quot;RTC.h&quot;</span>
<a name="l00027"></a>00027
<a name="l00028"></a>00028 <span class="keyword">class </span><a class="code" href="classI2CMaster.html" title="Abstract base class for I2C master implementations.">I2CMaster</a>;
<a name="l00029"></a>00029
<a name="l00030"></a><a class="code" href="classDS3232RTC.html">00030</a> <span class="keyword">class </span><a class="code" href="classDS3232RTC.html" title="Communicates with a DS3232 realtime clock chip via I2C.">DS3232RTC</a> : <span class="keyword">public</span> <a class="code" href="classRTC.html" title="Base class for realtime clock handlers.">RTC</a> {
<a name="l00031"></a>00031 <span class="keyword">public</span>:
<a name="l00032"></a>00032 <a class="code" href="classDS3232RTC.html#aa959454ae01b11c48d6ec7ec192b4ccb" title="Attaches to a realtime clock slave device on bus.">DS3232RTC</a>(<a class="code" href="classI2CMaster.html" title="Abstract base class for I2C master implementations.">I2CMaster</a> &amp;bus, uint8_t oneHzPin = 255);
<a name="l00033"></a>00033
<a name="l00034"></a><a class="code" href="classDS3232RTC.html#acc5908a3743afb4c26bd75e22cad87a4">00034</a> <span class="keywordtype">bool</span> <a class="code" href="classDS3232RTC.html#acc5908a3743afb4c26bd75e22cad87a4" title="Returns true if the realtime clock is on the I2C bus; false if the time and date are simulated...">isRealTime</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _isRealTime; }
<a name="l00035"></a>00035
<a name="l00036"></a>00036 <span class="keywordtype">bool</span> <a class="code" href="classDS3232RTC.html#a619ffee1bc013c9ddf4ae415115798bc" title="Returns true if the realtime clock has updated since the last call to this function.">hasUpdates</a>();
<a name="l00037"></a>00037
<a name="l00038"></a>00038 <span class="keywordtype">void</span> <a class="code" href="classDS3232RTC.html#af89e68c68f1c4b7e94286f800b5b2747" title="Reads the current time from the realtime clock into value.">readTime</a>(<a class="code" href="structRTCTime.html" title="Stores time information from a realtime clock chip.">RTCTime</a> *value);
<a name="l00039"></a>00039 <span class="keywordtype">void</span> <a class="code" href="classDS3232RTC.html#ab03358e3b5996e38d766e2f9f6ab62ca" title="Reads the current date from the realtime clock into value.">readDate</a>(<a class="code" href="structRTCDate.html" title="Stores date information from a realtime clock chip.">RTCDate</a> *value);
<a name="l00040"></a>00040
<a name="l00041"></a>00041 <span class="keywordtype">void</span> <a class="code" href="classDS3232RTC.html#ab0ca13a8b80da856b37fc53b84e27c78" title="Updates the time in the realtime clock to match value.">writeTime</a>(<span class="keyword">const</span> <a class="code" href="structRTCTime.html" title="Stores time information from a realtime clock chip.">RTCTime</a> *value);
<a name="l00042"></a>00042 <span class="keywordtype">void</span> <a class="code" href="classDS3232RTC.html#a31c004a90c724979d8267c31f2dbf5ed" title="Updates the date in the realtime clock to match value.">writeDate</a>(<span class="keyword">const</span> <a class="code" href="structRTCDate.html" title="Stores date information from a realtime clock chip.">RTCDate</a> *value);
<a name="l00043"></a>00043
<a name="l00044"></a>00044 <span class="keywordtype">void</span> <a class="code" href="classDS3232RTC.html#a09c7073c687dcbbc423baf48074c7873" title="Reads the details of the alarm with index alarmNum into value.">readAlarm</a>(uint8_t alarmNum, <a class="code" href="structRTCAlarm.html" title="Stores alarm information from a realtime clock chip.">RTCAlarm</a> *value);
<a name="l00045"></a>00045 <span class="keywordtype">void</span> <a class="code" href="classDS3232RTC.html#a8b0a65e0ac479aec8fad6ca3147dbe75" title="Updates the details of the alarm with index alarmNum from value.">writeAlarm</a>(uint8_t alarmNum, <span class="keyword">const</span> <a class="code" href="structRTCAlarm.html" title="Stores alarm information from a realtime clock chip.">RTCAlarm</a> *value);
<a name="l00046"></a>00046
<a name="l00047"></a>00047 <span class="keywordtype">int</span> <a class="code" href="classDS3232RTC.html#a1319fe936dcb7e9d6bdf200b77a94f8e" title="Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings...">byteCount</a>() <span class="keyword">const</span>;
<a name="l00048"></a>00048 uint8_t <a class="code" href="classDS3232RTC.html#a5ba83a3ef7d65d45c2f3241afdd8fef7" title="Reads the byte at offset within the realtime clock&#39;s non-volatile memory.">readByte</a>(uint8_t offset);
<a name="l00049"></a>00049 <span class="keywordtype">void</span> <a class="code" href="classDS3232RTC.html#a9acebf12c5cecdd6d84e0ff9ed41765a" title="Writes value to offset within the realtime clock&#39;s non-volatile memory.">writeByte</a>(uint8_t offset, uint8_t value);
<a name="l00050"></a>00050
<a name="l00051"></a>00051 <span class="keywordtype">void</span> <a class="code" href="classDS3232RTC.html#ab91e79271a1f8e75b07bddbb04445dc9" title="Enables the generation of interrupts for alarms 0 and 1.">enableAlarmInterrupts</a>();
<a name="l00052"></a>00052 <span class="keywordtype">void</span> <a class="code" href="classDS3232RTC.html#a225b8c62d617aa1b7be7d20e8a033be9" title="Disables the generation of interrupts for alarms 0 and 1.">disableAlarmInterrupts</a>();
<a name="l00053"></a>00053 <span class="keywordtype">int</span> <a class="code" href="classDS3232RTC.html#a79649f100a4562b9c1ba7c69e85cbca3" title="Determines which of alarms 0 or 1 have fired since the last call.">firedAlarm</a>();
<a name="l00054"></a>00054
<a name="l00055"></a>00055 <span class="keywordtype">void</span> <a class="code" href="classDS3232RTC.html#a3966de6f4241d86f198a8b9dd5e7e59a" title="Enables the 32 kHz output on the DS3232 chip.">enable32kHzOutput</a>();
<a name="l00056"></a>00056 <span class="keywordtype">void</span> <a class="code" href="classDS3232RTC.html#ada732bae42fc2833e59ae293aa27ddcb" title="Disables the 32 kHz output on the DS3232 chip.">disable32kHzOutput</a>();
<a name="l00057"></a>00057
<a name="l00058"></a>00058 <span class="keyword">private</span>:
<a name="l00059"></a>00059 <a class="code" href="classI2CMaster.html" title="Abstract base class for I2C master implementations.">I2CMaster</a> *_bus;
<a name="l00060"></a>00060 uint8_t _oneHzPin;
<a name="l00061"></a>00061 <span class="keywordtype">bool</span> prevOneHz;
<a name="l00062"></a>00062 <span class="keywordtype">bool</span> _isRealTime;
<a name="l00063"></a>00063 <span class="keywordtype">bool</span> alarmInterrupts;
<a name="l00064"></a>00064
<a name="l00065"></a>00065 <span class="keywordtype">void</span> initAlarms();
<a name="l00066"></a>00066
<a name="l00067"></a>00067 uint8_t readRegister(uint8_t reg);
<a name="l00068"></a>00068 <span class="keywordtype">bool</span> writeRegister(uint8_t reg, uint8_t value);
<a name="l00069"></a>00069
<a name="l00070"></a>00070 <span class="keywordtype">void</span> updateAlarmInterrupts();
<a name="l00071"></a>00071 };
<a name="l00072"></a>00072
<a name="l00073"></a>00073 <span class="preprocessor">#endif</span>
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:49 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

173
Field_8cpp_source.html Normal file
View File

@ -0,0 +1,173 @@
<!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"/>
<title>ArduinoLibs: Field.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">Field.cpp</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;Field.h&quot;</span>
<a name="l00024"></a>00024
<a name="l00040"></a><a class="code" href="classField.html#ac4ea0d104376233c3f0bfc080ec8564e">00040</a> <a class="code" href="classField.html#ac4ea0d104376233c3f0bfc080ec8564e" title="Constructs a new field with a specific label.">Field::Field</a>(<span class="keyword">const</span> String &amp;label)
<a name="l00041"></a>00041 : _label(label)
<a name="l00042"></a>00042 , _form(0)
<a name="l00043"></a>00043 , next(0)
<a name="l00044"></a>00044 , prev(0)
<a name="l00045"></a>00045 {
<a name="l00046"></a>00046 }
<a name="l00047"></a>00047
<a name="l00052"></a><a class="code" href="classField.html#a7e2bdb203ddfd9219696f263c1731fe7">00052</a> <a class="code" href="classField.html#ac4ea0d104376233c3f0bfc080ec8564e" title="Constructs a new field with a specific label.">Field::Field</a>(<a class="code" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> &amp;form, <span class="keyword">const</span> String &amp;label)
<a name="l00053"></a>00053 : _label(label)
<a name="l00054"></a>00054 , _form(0)
<a name="l00055"></a>00055 , next(0)
<a name="l00056"></a>00056 , prev(0)
<a name="l00057"></a>00057 {
<a name="l00058"></a>00058 form.<a class="code" href="classForm.html#a5cb056ace428e75e321610555bfecac7" title="Adds field to this form.">addField</a>(<span class="keyword">this</span>);
<a name="l00059"></a>00059 }
<a name="l00060"></a>00060
<a name="l00066"></a><a class="code" href="classField.html#a45d6e6d09b8f8e46de62b40119d62c60">00066</a> <a class="code" href="classField.html#a45d6e6d09b8f8e46de62b40119d62c60" title="Destroys this field and removes it from its owning Form.">Field::~Field</a>()
<a name="l00067"></a>00067 {
<a name="l00068"></a>00068 <span class="keywordflow">if</span> (_form)
<a name="l00069"></a>00069 _form-&gt;<a class="code" href="classForm.html#a7abd717029f9b19ee7318470072cd697" title="Removes field from this form.">removeField</a>(<span class="keyword">this</span>);
<a name="l00070"></a>00070 }
<a name="l00071"></a>00071
<a name="l00096"></a><a class="code" href="classField.html#a061bd1ed4d8b079df86465df8facd3b3">00096</a> <span class="keywordtype">int</span> <a class="code" href="classField.html#a061bd1ed4d8b079df86465df8facd3b3" title="Dispatches event via this field.">Field::dispatch</a>(<span class="keywordtype">int</span> event)
<a name="l00097"></a>00097 {
<a name="l00098"></a>00098 <span class="comment">// Nothing to do here.</span>
<a name="l00099"></a>00099 <span class="keywordflow">return</span> -1;
<a name="l00100"></a>00100 }
<a name="l00101"></a>00101
<a name="l00116"></a><a class="code" href="classField.html#aa032bbeacb405c56546cb56fbbee94f5">00116</a> <span class="keywordtype">void</span> <a class="code" href="classField.html#aa032bbeacb405c56546cb56fbbee94f5" title="Enters the field due to form navigation.">Field::enterField</a>(<span class="keywordtype">bool</span> reverse)
<a name="l00117"></a>00117 {
<a name="l00118"></a>00118 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;print(_label);
<a name="l00119"></a>00119 }
<a name="l00120"></a>00120
<a name="l00129"></a><a class="code" href="classField.html#ad6805c75ee1e62f8cd8bd550c4530c07">00129</a> <span class="keywordtype">void</span> <a class="code" href="classField.html#ad6805c75ee1e62f8cd8bd550c4530c07" title="Exits the field due to form navigation.">Field::exitField</a>()
<a name="l00130"></a>00130 {
<a name="l00131"></a>00131 <span class="comment">// Nothing to do here.</span>
<a name="l00132"></a>00132 }
<a name="l00133"></a>00133
<a name="l00146"></a><a class="code" href="classField.html#ad4ea63599d780c35b296cf2840b69f7b">00146</a> <span class="keywordtype">void</span> <a class="code" href="classField.html#ad4ea63599d780c35b296cf2840b69f7b" title="Sets the label to display in the first line of this field.">Field::setLabel</a>(<span class="keyword">const</span> String &amp;label)
<a name="l00147"></a>00147 {
<a name="l00148"></a>00148 <span class="keywordflow">if</span> (<a class="code" href="classField.html#a25d86a67b321e8c642edf75a10a35f72" title="Returns true if this field is the currently-displayed field in its owning form; false otherwise...">isCurrent</a>()) {
<a name="l00149"></a>00149 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> prevLen = _label.length();
<a name="l00150"></a>00150 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> newLen = label.length();
<a name="l00151"></a>00151 _label = <a class="code" href="classField.html#aaa861ef917130c989a955bc75c683afe" title="Returns the label to display in the first line of this field.">label</a>;
<a name="l00152"></a>00152 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;setCursor(0, 0);
<a name="l00153"></a>00153 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;print(label);
<a name="l00154"></a>00154 <span class="keywordflow">while</span> (newLen++ &lt; prevLen)
<a name="l00155"></a>00155 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;write(<span class="charliteral">&#39; &#39;</span>);
<a name="l00156"></a>00156 <a class="code" href="classField.html#afc612378167be0e7f8a6f8395b3537bd" title="Updates the cursor position after the label has been drawn by setLabel().">updateCursor</a>();
<a name="l00157"></a>00157 } <span class="keywordflow">else</span> {
<a name="l00158"></a>00158 _label = <a class="code" href="classField.html#aaa861ef917130c989a955bc75c683afe" title="Returns the label to display in the first line of this field.">label</a>;
<a name="l00159"></a>00159 }
<a name="l00160"></a>00160 }
<a name="l00161"></a>00161
<a name="l00169"></a><a class="code" href="classField.html#a25d86a67b321e8c642edf75a10a35f72">00169</a> <span class="keywordtype">bool</span> <a class="code" href="classField.html#a25d86a67b321e8c642edf75a10a35f72" title="Returns true if this field is the currently-displayed field in its owning form; false otherwise...">Field::isCurrent</a>()<span class="keyword"> const</span>
<a name="l00170"></a>00170 <span class="keyword"></span>{
<a name="l00171"></a>00171 <span class="keywordflow">if</span> (!_form-&gt;<a class="code" href="classForm.html#a3101f288e3e5aa8307c57f35861ad587" title="Returns true if the form is shown; false if the form is hidden.">isVisible</a>())
<a name="l00172"></a>00172 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00173"></a>00173 <span class="keywordflow">return</span> _form-&gt;<a class="code" href="classForm.html#a85a219a73294cef1f89a2182b5c25bf8" title="Returns the current field that is displayed on-screen.">currentField</a>() == <span class="keyword">this</span>;
<a name="l00174"></a>00174 }
<a name="l00175"></a>00175
<a name="l00191"></a><a class="code" href="classField.html#afc612378167be0e7f8a6f8395b3537bd">00191</a> <span class="keywordtype">void</span> <a class="code" href="classField.html#afc612378167be0e7f8a6f8395b3537bd" title="Updates the cursor position after the label has been drawn by setLabel().">Field::updateCursor</a>()
<a name="l00192"></a>00192 {
<a name="l00193"></a>00193 <span class="comment">// Nothing to do here.</span>
<a name="l00194"></a>00194 }
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:49 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

143
Field_8h_source.html Normal file
View File

@ -0,0 +1,143 @@
<!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"/>
<title>ArduinoLibs: Field.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">Field.h</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#ifndef Field_h</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define Field_h</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &quot;Form.h&quot;</span>
<a name="l00027"></a>00027
<a name="l00028"></a><a class="code" href="classField.html">00028</a> <span class="keyword">class </span><a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> {
<a name="l00029"></a>00029 <span class="keyword">public</span>:
<a name="l00030"></a>00030 <span class="keyword">explicit</span> <a class="code" href="classField.html#ac4ea0d104376233c3f0bfc080ec8564e" title="Constructs a new field with a specific label.">Field</a>(<span class="keyword">const</span> String &amp;<a class="code" href="classField.html#aaa861ef917130c989a955bc75c683afe" title="Returns the label to display in the first line of this field.">label</a>);
<a name="l00031"></a>00031 <a class="code" href="classField.html#ac4ea0d104376233c3f0bfc080ec8564e" title="Constructs a new field with a specific label.">Field</a>(<a class="code" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> &amp;<a class="code" href="classField.html#a27427319be1cc92db3128637d8884ee5" title="Returns the Form that owns this field; null if not associated with a Form.">form</a>, <span class="keyword">const</span> String &amp;label);
<a name="l00032"></a>00032 <a class="code" href="classField.html#a45d6e6d09b8f8e46de62b40119d62c60" title="Destroys this field and removes it from its owning Form.">~Field</a>();
<a name="l00033"></a>00033
<a name="l00034"></a><a class="code" href="classField.html#a27427319be1cc92db3128637d8884ee5">00034</a> <a class="code" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> *<a class="code" href="classField.html#a27427319be1cc92db3128637d8884ee5" title="Returns the Form that owns this field; null if not associated with a Form.">form</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _form; }
<a name="l00035"></a>00035
<a name="l00036"></a>00036 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classField.html#a061bd1ed4d8b079df86465df8facd3b3" title="Dispatches event via this field.">dispatch</a>(<span class="keywordtype">int</span> event);
<a name="l00037"></a>00037
<a name="l00038"></a>00038 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classField.html#aa032bbeacb405c56546cb56fbbee94f5" title="Enters the field due to form navigation.">enterField</a>(<span class="keywordtype">bool</span> reverse);
<a name="l00039"></a>00039 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classField.html#ad6805c75ee1e62f8cd8bd550c4530c07" title="Exits the field due to form navigation.">exitField</a>();
<a name="l00040"></a>00040
<a name="l00041"></a><a class="code" href="classField.html#aaa861ef917130c989a955bc75c683afe">00041</a> <span class="keyword">const</span> String &amp;<a class="code" href="classField.html#aaa861ef917130c989a955bc75c683afe" title="Returns the label to display in the first line of this field.">label</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _label; }
<a name="l00042"></a>00042 <span class="keywordtype">void</span> <a class="code" href="classField.html#ad4ea63599d780c35b296cf2840b69f7b" title="Sets the label to display in the first line of this field.">setLabel</a>(<span class="keyword">const</span> String &amp;label);
<a name="l00043"></a>00043
<a name="l00044"></a>00044 <span class="keywordtype">bool</span> <a class="code" href="classField.html#a25d86a67b321e8c642edf75a10a35f72" title="Returns true if this field is the currently-displayed field in its owning form; false otherwise...">isCurrent</a>() <span class="keyword">const</span>;
<a name="l00045"></a>00045
<a name="l00046"></a>00046 <span class="keyword">protected</span>:
<a name="l00047"></a><a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1">00047</a> LiquidCrystal *<a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _form-&gt;_lcd; }
<a name="l00048"></a>00048
<a name="l00049"></a>00049 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classField.html#afc612378167be0e7f8a6f8395b3537bd" title="Updates the cursor position after the label has been drawn by setLabel().">updateCursor</a>();
<a name="l00050"></a>00050
<a name="l00051"></a>00051 <span class="keyword">private</span>:
<a name="l00052"></a>00052 String _label;
<a name="l00053"></a>00053 <a class="code" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> *_form;
<a name="l00054"></a>00054 <a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> *next;
<a name="l00055"></a>00055 <a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> *prev;
<a name="l00056"></a>00056
<a name="l00057"></a>00057 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a>;
<a name="l00058"></a>00058 };
<a name="l00059"></a>00059
<a name="l00060"></a>00060 <span class="preprocessor">#endif</span>
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:49 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

BIN
FormBool.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 KiB

BIN
FormInt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 KiB

BIN
FormText.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 KiB

BIN
FormTimeRO.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 KiB

BIN
FormTimeRW.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 453 KiB

255
Form_8cpp_source.html Normal file
View File

@ -0,0 +1,255 @@
<!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"/>
<title>ArduinoLibs: Form.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">Form.cpp</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;Form.h&quot;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &quot;Field.h&quot;</span>
<a name="l00025"></a>00025
<a name="l00047"></a><a class="code" href="classForm.html#ad30836b22edde707a52d94090b716996">00047</a> <a class="code" href="classForm.html#ad30836b22edde707a52d94090b716996" title="Constructs a new form and associates it with lcd.">Form::Form</a>(LiquidCrystal &amp;lcd)
<a name="l00048"></a>00048 : _lcd(&amp;lcd)
<a name="l00049"></a>00049 , first(0)
<a name="l00050"></a>00050 , last(0)
<a name="l00051"></a>00051 , current(0)
<a name="l00052"></a>00052 {
<a name="l00053"></a>00053 }
<a name="l00054"></a>00054
<a name="l00058"></a><a class="code" href="classForm.html#a9cda7cce41e81bfaca51e922d4f9b98f">00058</a> <a class="code" href="classForm.html#a9cda7cce41e81bfaca51e922d4f9b98f" title="Detaches all remaining fields and destroys this form.">Form::~Form</a>()
<a name="l00059"></a>00059 {
<a name="l00060"></a>00060 <a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> *field = first;
<a name="l00061"></a>00061 <a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> *next;
<a name="l00062"></a>00062 <span class="keywordflow">while</span> (field != 0) {
<a name="l00063"></a>00063 next = field-&gt;next;
<a name="l00064"></a>00064 field-&gt;_form = 0;
<a name="l00065"></a>00065 field-&gt;next = 0;
<a name="l00066"></a>00066 field-&gt;prev = 0;
<a name="l00067"></a>00067 field = next;
<a name="l00068"></a>00068 }
<a name="l00069"></a>00069 }
<a name="l00070"></a>00070
<a name="l00099"></a><a class="code" href="classForm.html#a89bd3850e87caa2ca7b2e946f923d0ee">00099</a> <span class="keywordtype">int</span> <a class="code" href="classForm.html#a89bd3850e87caa2ca7b2e946f923d0ee" title="Dispatches event to the currently active field using Field::dispatch().">Form::dispatch</a>(<span class="keywordtype">int</span> event)
<a name="l00100"></a>00100 {
<a name="l00101"></a>00101 <span class="keywordflow">if</span> (current) {
<a name="l00102"></a>00102 <span class="keywordtype">int</span> exitval = current-&gt;<a class="code" href="classField.html#a061bd1ed4d8b079df86465df8facd3b3" title="Dispatches event via this field.">dispatch</a>(event);
<a name="l00103"></a>00103 <span class="keywordflow">if</span> (exitval &gt;= 0)
<a name="l00104"></a>00104 <span class="keywordflow">return</span> exitval;
<a name="l00105"></a>00105 }
<a name="l00106"></a>00106 <span class="keywordflow">if</span> (event == LCD_BUTTON_LEFT)
<a name="l00107"></a>00107 <a class="code" href="classForm.html#acb080fe4f4631e9060e6efab8eaa0a90" title="Changes to the previous field in the &quot;tab order&quot;.">prevField</a>();
<a name="l00108"></a>00108 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (event == LCD_BUTTON_RIGHT)
<a name="l00109"></a>00109 <a class="code" href="classForm.html#a788a186ea4a7ebd75283a948ca45f4d1" title="Changes to the next field in the &quot;tab order&quot;.">nextField</a>();
<a name="l00110"></a>00110 <span class="keywordflow">return</span> 0;
<a name="l00111"></a>00111 }
<a name="l00112"></a>00112
<a name="l00118"></a><a class="code" href="classForm.html#a788a186ea4a7ebd75283a948ca45f4d1">00118</a> <span class="keywordtype">void</span> <a class="code" href="classForm.html#a788a186ea4a7ebd75283a948ca45f4d1" title="Changes to the next field in the &quot;tab order&quot;.">Form::nextField</a>()
<a name="l00119"></a>00119 {
<a name="l00120"></a>00120 <a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> *field = current;
<a name="l00121"></a>00121 <span class="keywordflow">if</span> (!field)
<a name="l00122"></a>00122 field = first;
<a name="l00123"></a>00123 <span class="keywordflow">if</span> (field &amp;&amp; field-&gt;next)
<a name="l00124"></a>00124 field = field-&gt;next;
<a name="l00125"></a>00125 <span class="keywordflow">else</span>
<a name="l00126"></a>00126 field = first;
<a name="l00127"></a>00127 <a class="code" href="classForm.html#ae6004fedfa07191ffd47d7b12370b4e5" title="Sets the current field that is displayed on-screen.">setCurrentField</a>(field);
<a name="l00128"></a>00128 }
<a name="l00129"></a>00129
<a name="l00135"></a><a class="code" href="classForm.html#acb080fe4f4631e9060e6efab8eaa0a90">00135</a> <span class="keywordtype">void</span> <a class="code" href="classForm.html#acb080fe4f4631e9060e6efab8eaa0a90" title="Changes to the previous field in the &quot;tab order&quot;.">Form::prevField</a>()
<a name="l00136"></a>00136 {
<a name="l00137"></a>00137 <a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> *field = current;
<a name="l00138"></a>00138 <span class="keywordflow">if</span> (!field)
<a name="l00139"></a>00139 field = last;
<a name="l00140"></a>00140 <span class="keywordflow">if</span> (field &amp;&amp; field-&gt;prev)
<a name="l00141"></a>00141 field = field-&gt;prev;
<a name="l00142"></a>00142 <span class="keywordflow">else</span>
<a name="l00143"></a>00143 field = last;
<a name="l00144"></a>00144 <a class="code" href="classForm.html#ae6004fedfa07191ffd47d7b12370b4e5" title="Sets the current field that is displayed on-screen.">setCurrentField</a>(field);
<a name="l00145"></a>00145 }
<a name="l00146"></a>00146
<a name="l00152"></a><a class="code" href="classForm.html#aba75b59f68b31dd77dbbac9ab5c3124b">00152</a> <span class="keywordtype">void</span> <a class="code" href="classForm.html#aba75b59f68b31dd77dbbac9ab5c3124b" title="Changes to default field (i.e., the first field).">Form::defaultField</a>()
<a name="l00153"></a>00153 {
<a name="l00154"></a>00154 <a class="code" href="classForm.html#ae6004fedfa07191ffd47d7b12370b4e5" title="Sets the current field that is displayed on-screen.">setCurrentField</a>(first);
<a name="l00155"></a>00155 }
<a name="l00156"></a>00156
<a name="l00165"></a><a class="code" href="classForm.html#a5cb056ace428e75e321610555bfecac7">00165</a> <span class="keywordtype">void</span> <a class="code" href="classForm.html#a5cb056ace428e75e321610555bfecac7" title="Adds field to this form.">Form::addField</a>(<a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> *field)
<a name="l00166"></a>00166 {
<a name="l00167"></a>00167 <span class="keywordflow">if</span> (field-&gt;_form)
<a name="l00168"></a>00168 <span class="keywordflow">return</span>; <span class="comment">// Already added to a form.</span>
<a name="l00169"></a>00169 field-&gt;_form = <span class="keyword">this</span>;
<a name="l00170"></a>00170 field-&gt;next = 0;
<a name="l00171"></a>00171 field-&gt;prev = last;
<a name="l00172"></a>00172 <span class="keywordflow">if</span> (last)
<a name="l00173"></a>00173 last-&gt;next = field;
<a name="l00174"></a>00174 <span class="keywordflow">else</span>
<a name="l00175"></a>00175 first = field;
<a name="l00176"></a>00176 last = field;
<a name="l00177"></a>00177 }
<a name="l00178"></a>00178
<a name="l00187"></a><a class="code" href="classForm.html#a7abd717029f9b19ee7318470072cd697">00187</a> <span class="keywordtype">void</span> <a class="code" href="classForm.html#a7abd717029f9b19ee7318470072cd697" title="Removes field from this form.">Form::removeField</a>(<a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> *field)
<a name="l00188"></a>00188 {
<a name="l00189"></a>00189 <span class="keywordflow">if</span> (field-&gt;_form != <span class="keyword">this</span>)
<a name="l00190"></a>00190 <span class="keywordflow">return</span>; <span class="comment">// Not a member of this form.</span>
<a name="l00191"></a>00191 <span class="keywordflow">if</span> (current == field) {
<a name="l00192"></a>00192 <span class="keywordflow">if</span> (field-&gt;next)
<a name="l00193"></a>00193 <a class="code" href="classForm.html#ae6004fedfa07191ffd47d7b12370b4e5" title="Sets the current field that is displayed on-screen.">setCurrentField</a>(field-&gt;next);
<a name="l00194"></a>00194 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (field-&gt;prev)
<a name="l00195"></a>00195 <a class="code" href="classForm.html#ae6004fedfa07191ffd47d7b12370b4e5" title="Sets the current field that is displayed on-screen.">setCurrentField</a>(field-&gt;prev);
<a name="l00196"></a>00196 <span class="keywordflow">else</span>
<a name="l00197"></a>00197 <a class="code" href="classForm.html#ae6004fedfa07191ffd47d7b12370b4e5" title="Sets the current field that is displayed on-screen.">setCurrentField</a>(0);
<a name="l00198"></a>00198 }
<a name="l00199"></a>00199 <span class="keywordflow">if</span> (field-&gt;next)
<a name="l00200"></a>00200 field-&gt;next-&gt;prev = field-&gt;prev;
<a name="l00201"></a>00201 <span class="keywordflow">else</span>
<a name="l00202"></a>00202 last = field-&gt;prev;
<a name="l00203"></a>00203 <span class="keywordflow">if</span> (field-&gt;prev)
<a name="l00204"></a>00204 field-&gt;prev-&gt;next = field-&gt;next;
<a name="l00205"></a>00205 <span class="keywordflow">else</span>
<a name="l00206"></a>00206 first = field-&gt;next;
<a name="l00207"></a>00207 field-&gt;_form = 0;
<a name="l00208"></a>00208 field-&gt;next = 0;
<a name="l00209"></a>00209 field-&gt;prev = 0;
<a name="l00210"></a>00210 }
<a name="l00211"></a>00211
<a name="l00230"></a><a class="code" href="classForm.html#ae6004fedfa07191ffd47d7b12370b4e5">00230</a> <span class="keywordtype">void</span> <a class="code" href="classForm.html#ae6004fedfa07191ffd47d7b12370b4e5" title="Sets the current field that is displayed on-screen.">Form::setCurrentField</a>(<a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> *field)
<a name="l00231"></a>00231 {
<a name="l00232"></a>00232 <span class="keywordflow">if</span> (field &amp;&amp; field-&gt;_form != <span class="keyword">this</span>)
<a name="l00233"></a>00233 <span class="keywordflow">return</span>; <span class="comment">// Wrong form.</span>
<a name="l00234"></a>00234 <span class="keywordflow">if</span> (visible) {
<a name="l00235"></a>00235 <span class="keywordtype">bool</span> reverse = <span class="keyword">false</span>;
<a name="l00236"></a>00236 <span class="keywordflow">if</span> (current) {
<a name="l00237"></a>00237 current-&gt;<a class="code" href="classField.html#ad6805c75ee1e62f8cd8bd550c4530c07" title="Exits the field due to form navigation.">exitField</a>();
<a name="l00238"></a>00238 <span class="keywordflow">if</span> (field-&gt;next == current)
<a name="l00239"></a>00239 reverse = <span class="keyword">true</span>;
<a name="l00240"></a>00240 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!field-&gt;next &amp;&amp; current == first)
<a name="l00241"></a>00241 reverse = <span class="keyword">true</span>;
<a name="l00242"></a>00242 }
<a name="l00243"></a>00243 current = field;
<a name="l00244"></a>00244 _lcd-&gt;clear();
<a name="l00245"></a>00245 <span class="keywordflow">if</span> (current)
<a name="l00246"></a>00246 current-&gt;<a class="code" href="classField.html#aa032bbeacb405c56546cb56fbbee94f5" title="Enters the field due to form navigation.">enterField</a>(reverse);
<a name="l00247"></a>00247 } <span class="keywordflow">else</span> {
<a name="l00248"></a>00248 current = field;
<a name="l00249"></a>00249 }
<a name="l00250"></a>00250 }
<a name="l00251"></a>00251
<a name="l00274"></a><a class="code" href="classForm.html#a9e8d718ab55a8034c22c606ccfa90d65">00274</a> <span class="keywordtype">void</span> <a class="code" href="classForm.html#a9e8d718ab55a8034c22c606ccfa90d65" title="Shows the form, or does nothing if the form is already on-screen.">Form::show</a>()
<a name="l00275"></a>00275 {
<a name="l00276"></a>00276 <span class="keywordflow">if</span> (!visible) {
<a name="l00277"></a>00277 <span class="keywordflow">if</span> (!current)
<a name="l00278"></a>00278 current = first;
<a name="l00279"></a>00279 visible = <span class="keyword">true</span>;
<a name="l00280"></a>00280 _lcd-&gt;clear();
<a name="l00281"></a>00281 <span class="keywordflow">if</span> (current)
<a name="l00282"></a>00282 current-&gt;<a class="code" href="classField.html#aa032bbeacb405c56546cb56fbbee94f5" title="Enters the field due to form navigation.">enterField</a>(<span class="keyword">false</span>);
<a name="l00283"></a>00283 }
<a name="l00284"></a>00284 }
<a name="l00285"></a>00285
<a name="l00293"></a><a class="code" href="classForm.html#a88b9146a3f68e837c5e831203096f9e9">00293</a> <span class="keywordtype">void</span> <a class="code" href="classForm.html#a88b9146a3f68e837c5e831203096f9e9" title="Hides the form, or does nothing if the form is not on-screen.">Form::hide</a>()
<a name="l00294"></a>00294 {
<a name="l00295"></a>00295 <span class="keywordflow">if</span> (visible) {
<a name="l00296"></a>00296 <span class="keywordflow">if</span> (current)
<a name="l00297"></a>00297 current-&gt;<a class="code" href="classField.html#ad6805c75ee1e62f8cd8bd550c4530c07" title="Exits the field due to form navigation.">exitField</a>();
<a name="l00298"></a>00298 visible = <span class="keyword">false</span>;
<a name="l00299"></a>00299 _lcd-&gt;clear();
<a name="l00300"></a>00300 }
<a name="l00301"></a>00301 }
<a name="l00302"></a>00302
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:49 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

148
Form_8h_source.html Normal file
View File

@ -0,0 +1,148 @@
<!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"/>
<title>ArduinoLibs: Form.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">Form.h</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#ifndef Form_h</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define Form_h</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &quot;LCD.h&quot;</span>
<a name="l00027"></a>00027
<a name="l00028"></a>00028 <span class="keyword">class </span><a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a>;
<a name="l00029"></a>00029
<a name="l00030"></a>00030 <span class="preprocessor">#define FORM_CHANGED 1</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span>
<a name="l00032"></a><a class="code" href="classForm.html">00032</a> <span class="keyword">class </span><a class="code" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> {
<a name="l00033"></a>00033 <span class="keyword">public</span>:
<a name="l00034"></a>00034 <span class="keyword">explicit</span> <a class="code" href="classForm.html#ad30836b22edde707a52d94090b716996" title="Constructs a new form and associates it with lcd.">Form</a>(LiquidCrystal &amp;lcd);
<a name="l00035"></a>00035 <a class="code" href="classForm.html#a9cda7cce41e81bfaca51e922d4f9b98f" title="Detaches all remaining fields and destroys this form.">~Form</a>();
<a name="l00036"></a>00036
<a name="l00037"></a>00037 <span class="keywordtype">int</span> <a class="code" href="classForm.html#a89bd3850e87caa2ca7b2e946f923d0ee" title="Dispatches event to the currently active field using Field::dispatch().">dispatch</a>(<span class="keywordtype">int</span> event);
<a name="l00038"></a>00038
<a name="l00039"></a>00039 <span class="keywordtype">void</span> <a class="code" href="classForm.html#a788a186ea4a7ebd75283a948ca45f4d1" title="Changes to the next field in the &quot;tab order&quot;.">nextField</a>();
<a name="l00040"></a>00040 <span class="keywordtype">void</span> <a class="code" href="classForm.html#acb080fe4f4631e9060e6efab8eaa0a90" title="Changes to the previous field in the &quot;tab order&quot;.">prevField</a>();
<a name="l00041"></a>00041 <span class="keywordtype">void</span> <a class="code" href="classForm.html#aba75b59f68b31dd77dbbac9ab5c3124b" title="Changes to default field (i.e., the first field).">defaultField</a>();
<a name="l00042"></a>00042
<a name="l00043"></a>00043 <span class="keywordtype">void</span> <a class="code" href="classForm.html#a5cb056ace428e75e321610555bfecac7" title="Adds field to this form.">addField</a>(<a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> *field);
<a name="l00044"></a>00044 <span class="keywordtype">void</span> <a class="code" href="classForm.html#a7abd717029f9b19ee7318470072cd697" title="Removes field from this form.">removeField</a>(<a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> *field);
<a name="l00045"></a>00045
<a name="l00046"></a><a class="code" href="classForm.html#a85a219a73294cef1f89a2182b5c25bf8">00046</a> <a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> *<a class="code" href="classForm.html#a85a219a73294cef1f89a2182b5c25bf8" title="Returns the current field that is displayed on-screen.">currentField</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> current; }
<a name="l00047"></a>00047 <span class="keywordtype">void</span> <a class="code" href="classForm.html#ae6004fedfa07191ffd47d7b12370b4e5" title="Sets the current field that is displayed on-screen.">setCurrentField</a>(<a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> *field);
<a name="l00048"></a>00048
<a name="l00049"></a><a class="code" href="classForm.html#a48fb77f93e77b28b0397b59e1e9bf789">00049</a> <span class="keywordtype">bool</span> <a class="code" href="classForm.html#a48fb77f93e77b28b0397b59e1e9bf789" title="Returns true if field is currently displayed on-screen, false otherwise.">isCurrent</a>(<a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> &amp;field)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> current == &amp;field; }
<a name="l00050"></a>00050
<a name="l00051"></a>00051 <span class="keywordtype">void</span> <a class="code" href="classForm.html#a9e8d718ab55a8034c22c606ccfa90d65" title="Shows the form, or does nothing if the form is already on-screen.">show</a>();
<a name="l00052"></a>00052 <span class="keywordtype">void</span> <a class="code" href="classForm.html#a88b9146a3f68e837c5e831203096f9e9" title="Hides the form, or does nothing if the form is not on-screen.">hide</a>();
<a name="l00053"></a><a class="code" href="classForm.html#a3101f288e3e5aa8307c57f35861ad587">00053</a> <span class="keywordtype">bool</span> <a class="code" href="classForm.html#a3101f288e3e5aa8307c57f35861ad587" title="Returns true if the form is shown; false if the form is hidden.">isVisible</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> visible; }
<a name="l00054"></a>00054
<a name="l00055"></a>00055 <span class="keyword">private</span>:
<a name="l00056"></a>00056 LiquidCrystal *_lcd;
<a name="l00057"></a>00057 <a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> *first;
<a name="l00058"></a>00058 <a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> *last;
<a name="l00059"></a>00059 <a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> *current;
<a name="l00060"></a>00060 <span class="keywordtype">bool</span> visible;
<a name="l00061"></a>00061
<a name="l00062"></a>00062 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a>;
<a name="l00063"></a>00063 };
<a name="l00064"></a>00064
<a name="l00065"></a>00065 <span class="preprocessor">#endif</span>
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:49 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

BIN
HelloWorld.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 KiB

107
I2CMaster_8cpp_source.html Normal file
View File

@ -0,0 +1,107 @@
<!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"/>
<title>ArduinoLibs: I2CMaster.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">I2CMaster.cpp</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;I2CMaster.h&quot;</span>
<a name="l00024"></a>00024
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:49 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

124
I2CMaster_8h_source.html Normal file
View File

@ -0,0 +1,124 @@
<!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"/>
<title>ArduinoLibs: I2CMaster.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">I2CMaster.h</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#ifndef I2CMaster_h</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define I2CMaster_h</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;inttypes.h&gt;</span>
<a name="l00027"></a>00027
<a name="l00028"></a><a class="code" href="classI2CMaster.html">00028</a> <span class="keyword">class </span><a class="code" href="classI2CMaster.html" title="Abstract base class for I2C master implementations.">I2CMaster</a> {
<a name="l00029"></a>00029 <span class="keyword">public</span>:
<a name="l00030"></a>00030 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classI2CMaster.html#a3cd0cea8169ac4e6dd6f39fd6cfb1926" title="Returns the maximum number of bytes that can be read or written in a single request by this bus maste...">maxTransferSize</a>() <span class="keyword">const</span> = 0;
<a name="l00031"></a>00031
<a name="l00032"></a>00032 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> address);
<a name="l00033"></a>00033 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write</a>(uint8_t value) = 0;
<a name="l00034"></a>00034 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classI2CMaster.html#ab29f63551ddeb032a91505d1c0b8ac41" title="Ends the current write operation.">endWrite</a>() = 0;
<a name="l00035"></a>00035
<a name="l00036"></a>00036 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classI2CMaster.html#a4e5f1a1a4c2242699be5a35fc4872fde" title="Starts a read operation for count bytes by sending the start condition and the I2C control byte...">startRead</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> address, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> count) = 0;
<a name="l00037"></a>00037 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classI2CMaster.html#a6458fa99cfd9e6270ae6dff993955833" title="Returns the number of bytes that are still available for reading.">available</a>() = 0;
<a name="l00038"></a>00038 <span class="keyword">virtual</span> uint8_t <a class="code" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd" title="Reads a single byte from the I2C bus.">read</a>() = 0;
<a name="l00039"></a>00039 };
<a name="l00040"></a>00040
<a name="l00041"></a>00041 <span class="preprocessor">#endif</span>
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:49 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

188
IntField_8cpp_source.html Normal file
View File

@ -0,0 +1,188 @@
<!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"/>
<title>ArduinoLibs: IntField.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">IntField.cpp</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;IntField.h&quot;</span>
<a name="l00024"></a>00024
<a name="l00071"></a><a class="code" href="classIntField.html#a9df274c4100ed37d2d78738f09fc53b6">00071</a> <a class="code" href="classIntField.html#a9df274c4100ed37d2d78738f09fc53b6" title="Constructs a new integer field with a specific label.">IntField::IntField</a>(<span class="keyword">const</span> String &amp;label)
<a name="l00072"></a>00072 : <a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a>(label)
<a name="l00073"></a>00073 , _minValue(0)
<a name="l00074"></a>00074 , _maxValue(100)
<a name="l00075"></a>00075 , _stepValue(1)
<a name="l00076"></a>00076 , _value(0)
<a name="l00077"></a>00077 , _printLen(0)
<a name="l00078"></a>00078 {
<a name="l00079"></a>00079 }
<a name="l00080"></a>00080
<a name="l00088"></a><a class="code" href="classIntField.html#a10c9c958bcde276698f1f1f9bff949dd">00088</a> <a class="code" href="classIntField.html#a9df274c4100ed37d2d78738f09fc53b6" title="Constructs a new integer field with a specific label.">IntField::IntField</a>(<a class="code" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> &amp;form, <span class="keyword">const</span> String &amp;label, <span class="keywordtype">int</span> minValue, <span class="keywordtype">int</span> maxValue, <span class="keywordtype">int</span> stepValue, <span class="keywordtype">int</span> value)
<a name="l00089"></a>00089 : <a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a>(form, label)
<a name="l00090"></a>00090 , _minValue(minValue)
<a name="l00091"></a>00091 , _maxValue(maxValue)
<a name="l00092"></a>00092 , _stepValue(stepValue)
<a name="l00093"></a>00093 , _value(value)
<a name="l00094"></a>00094 , _printLen(0)
<a name="l00095"></a>00095 {
<a name="l00096"></a>00096 }
<a name="l00097"></a>00097
<a name="l00103"></a><a class="code" href="classIntField.html#a2b99fa19be6a0ed01ddc4939352b372e">00103</a> <a class="code" href="classIntField.html#a9df274c4100ed37d2d78738f09fc53b6" title="Constructs a new integer field with a specific label.">IntField::IntField</a>(<a class="code" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> &amp;form, <span class="keyword">const</span> String &amp;label, <span class="keywordtype">int</span> minValue, <span class="keywordtype">int</span> maxValue, <span class="keywordtype">int</span> stepValue, <span class="keywordtype">int</span> value, <span class="keyword">const</span> String &amp;suffix)
<a name="l00104"></a>00104 : <a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a>(form, label)
<a name="l00105"></a>00105 , _minValue(minValue)
<a name="l00106"></a>00106 , _maxValue(maxValue)
<a name="l00107"></a>00107 , _stepValue(stepValue)
<a name="l00108"></a>00108 , _value(value)
<a name="l00109"></a>00109 , _printLen(0)
<a name="l00110"></a>00110 , _suffix(suffix)
<a name="l00111"></a>00111 {
<a name="l00112"></a>00112 }
<a name="l00113"></a>00113
<a name="l00114"></a><a class="code" href="classIntField.html#a01a17d5a89c76c42c4f0516984ce653f">00114</a> <span class="keywordtype">int</span> <a class="code" href="classIntField.html#a01a17d5a89c76c42c4f0516984ce653f" title="Dispatches event via this field.">IntField::dispatch</a>(<span class="keywordtype">int</span> event)
<a name="l00115"></a>00115 {
<a name="l00116"></a>00116 <span class="keywordflow">if</span> (event == LCD_BUTTON_UP) {
<a name="l00117"></a>00117 <a class="code" href="classIntField.html#aed421e2c52946f2c7643534b4f6f13f7" title="Sets the current value of this field.">setValue</a>(_value + _stepValue);
<a name="l00118"></a>00118 <span class="keywordflow">return</span> FORM_CHANGED;
<a name="l00119"></a>00119 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (event == LCD_BUTTON_DOWN) {
<a name="l00120"></a>00120 <a class="code" href="classIntField.html#aed421e2c52946f2c7643534b4f6f13f7" title="Sets the current value of this field.">setValue</a>(_value - _stepValue);
<a name="l00121"></a>00121 <span class="keywordflow">return</span> FORM_CHANGED;
<a name="l00122"></a>00122 }
<a name="l00123"></a>00123 <span class="keywordflow">return</span> -1;
<a name="l00124"></a>00124 }
<a name="l00125"></a>00125
<a name="l00126"></a><a class="code" href="classIntField.html#a51d9127b660e8dd7f87718acd230202a">00126</a> <span class="keywordtype">void</span> <a class="code" href="classIntField.html#a51d9127b660e8dd7f87718acd230202a" title="Enters the field due to form navigation.">IntField::enterField</a>(<span class="keywordtype">bool</span> reverse)
<a name="l00127"></a>00127 {
<a name="l00128"></a>00128 <a class="code" href="classIntField.html#a51d9127b660e8dd7f87718acd230202a" title="Enters the field due to form navigation.">Field::enterField</a>(reverse);
<a name="l00129"></a>00129 printValue();
<a name="l00130"></a>00130 }
<a name="l00131"></a>00131
<a name="l00198"></a><a class="code" href="classIntField.html#aed421e2c52946f2c7643534b4f6f13f7">00198</a> <span class="keywordtype">void</span> <a class="code" href="classIntField.html#aed421e2c52946f2c7643534b4f6f13f7" title="Sets the current value of this field.">IntField::setValue</a>(<span class="keywordtype">int</span> value)
<a name="l00199"></a>00199 {
<a name="l00200"></a>00200 <span class="keywordflow">if</span> (value &lt; _minValue)
<a name="l00201"></a>00201 value = _minValue;
<a name="l00202"></a>00202 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (value &gt; _maxValue)
<a name="l00203"></a>00203 value = _maxValue;
<a name="l00204"></a>00204 <span class="keywordflow">if</span> (value != _value) {
<a name="l00205"></a>00205 _value = <a class="code" href="classIntField.html#a2fb650827ce8cb4662253bb6c32acb52" title="Returns the current value of this field.">value</a>;
<a name="l00206"></a>00206 <span class="keywordflow">if</span> (<a class="code" href="classField.html#a25d86a67b321e8c642edf75a10a35f72" title="Returns true if this field is the currently-displayed field in its owning form; false otherwise...">isCurrent</a>())
<a name="l00207"></a>00207 printValue();
<a name="l00208"></a>00208 }
<a name="l00209"></a>00209 }
<a name="l00210"></a>00210
<a name="l00231"></a><a class="code" href="classIntField.html#a9324bba994389f3a4563d9c18bd2f1cd">00231</a> <span class="keywordtype">void</span> <a class="code" href="classIntField.html#a9324bba994389f3a4563d9c18bd2f1cd" title="Sets the suffix string to be displayed after the field&#39;s value.">IntField::setSuffix</a>(<span class="keyword">const</span> String &amp;suffix)
<a name="l00232"></a>00232 {
<a name="l00233"></a>00233 _suffix = <a class="code" href="classIntField.html#a1a1de6a1836dfdb820c92b7f188a1b05" title="Returns the suffix string to be displayed after the field&#39;s value.">suffix</a>;
<a name="l00234"></a>00234 <span class="keywordflow">if</span> (<a class="code" href="classField.html#a25d86a67b321e8c642edf75a10a35f72" title="Returns true if this field is the currently-displayed field in its owning form; false otherwise...">isCurrent</a>())
<a name="l00235"></a>00235 printValue();
<a name="l00236"></a>00236 }
<a name="l00237"></a>00237
<a name="l00238"></a>00238 <span class="keywordtype">void</span> IntField::printValue()
<a name="l00239"></a>00239 {
<a name="l00240"></a>00240 String str(_value);
<a name="l00241"></a>00241 <span class="keywordflow">if</span> (_suffix.length())
<a name="l00242"></a>00242 str += _suffix;
<a name="l00243"></a>00243 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;setCursor(0, 1);
<a name="l00244"></a>00244 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;print(str);
<a name="l00245"></a>00245 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> len = str.length();
<a name="l00246"></a>00246 <span class="keywordflow">while</span> (len++ &lt; _printLen)
<a name="l00247"></a>00247 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;write(<span class="charliteral">&#39; &#39;</span>);
<a name="l00248"></a>00248 _printLen = str.length();
<a name="l00249"></a>00249 }
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:49 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

147
IntField_8h_source.html Normal file
View File

@ -0,0 +1,147 @@
<!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"/>
<title>ArduinoLibs: IntField.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">IntField.h</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#ifndef IntField_h</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define IntField_h</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &quot;Field.h&quot;</span>
<a name="l00027"></a>00027
<a name="l00028"></a><a class="code" href="classIntField.html">00028</a> <span class="keyword">class </span><a class="code" href="classIntField.html" title="Field that manages the input of an integer value.">IntField</a> : <span class="keyword">public</span> <a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> {
<a name="l00029"></a>00029 <span class="keyword">public</span>:
<a name="l00030"></a>00030 <span class="keyword">explicit</span> <a class="code" href="classIntField.html#a9df274c4100ed37d2d78738f09fc53b6" title="Constructs a new integer field with a specific label.">IntField</a>(<span class="keyword">const</span> String &amp;<a class="code" href="classField.html#aaa861ef917130c989a955bc75c683afe" title="Returns the label to display in the first line of this field.">label</a>);
<a name="l00031"></a>00031 <a class="code" href="classIntField.html#a9df274c4100ed37d2d78738f09fc53b6" title="Constructs a new integer field with a specific label.">IntField</a>(<a class="code" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> &amp;<a class="code" href="classField.html#a27427319be1cc92db3128637d8884ee5" title="Returns the Form that owns this field; null if not associated with a Form.">form</a>, <span class="keyword">const</span> String &amp;label, <span class="keywordtype">int</span> <a class="code" href="classIntField.html#af3dab3f2b46d29136d7a93ce46b0b8fb" title="Returns the minimum value for the input field.">minValue</a>, <span class="keywordtype">int</span> <a class="code" href="classIntField.html#aaa0adcb0d16e822e5f176be5cb9ca8ad" title="Returns the maximum value for the input field.">maxValue</a>, <span class="keywordtype">int</span> <a class="code" href="classIntField.html#a49025ee3473fe066a6a6c546af98bfbd" title="Returns the step value to use when increasing or decreasing the value() due to Up and Down button pre...">stepValue</a>, <span class="keywordtype">int</span> <a class="code" href="classIntField.html#a2fb650827ce8cb4662253bb6c32acb52" title="Returns the current value of this field.">value</a>);
<a name="l00032"></a>00032 <a class="code" href="classIntField.html#a9df274c4100ed37d2d78738f09fc53b6" title="Constructs a new integer field with a specific label.">IntField</a>(<a class="code" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> &amp;form, <span class="keyword">const</span> String &amp;label, <span class="keywordtype">int</span> minValue, <span class="keywordtype">int</span> maxValue, <span class="keywordtype">int</span> stepValue, <span class="keywordtype">int</span> value, <span class="keyword">const</span> String &amp;<a class="code" href="classIntField.html#a1a1de6a1836dfdb820c92b7f188a1b05" title="Returns the suffix string to be displayed after the field&#39;s value.">suffix</a>);
<a name="l00033"></a>00033
<a name="l00034"></a>00034 <span class="keywordtype">int</span> <a class="code" href="classIntField.html#a01a17d5a89c76c42c4f0516984ce653f" title="Dispatches event via this field.">dispatch</a>(<span class="keywordtype">int</span> event);
<a name="l00035"></a>00035
<a name="l00036"></a>00036 <span class="keywordtype">void</span> <a class="code" href="classIntField.html#a51d9127b660e8dd7f87718acd230202a" title="Enters the field due to form navigation.">enterField</a>(<span class="keywordtype">bool</span> reverse);
<a name="l00037"></a>00037
<a name="l00038"></a><a class="code" href="classIntField.html#af3dab3f2b46d29136d7a93ce46b0b8fb">00038</a> <span class="keywordtype">int</span> <a class="code" href="classIntField.html#af3dab3f2b46d29136d7a93ce46b0b8fb" title="Returns the minimum value for the input field.">minValue</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _minValue; }
<a name="l00039"></a><a class="code" href="classIntField.html#afffe7be6721a043cec7a5a85c19e0ada">00039</a> <span class="keywordtype">void</span> <a class="code" href="classIntField.html#afffe7be6721a043cec7a5a85c19e0ada" title="Sets the minimum value for the input field.">setMinValue</a>(<span class="keywordtype">int</span> value) { _minValue = <a class="code" href="classIntField.html#a2fb650827ce8cb4662253bb6c32acb52" title="Returns the current value of this field.">value</a>; }
<a name="l00040"></a>00040
<a name="l00041"></a><a class="code" href="classIntField.html#aaa0adcb0d16e822e5f176be5cb9ca8ad">00041</a> <span class="keywordtype">int</span> <a class="code" href="classIntField.html#aaa0adcb0d16e822e5f176be5cb9ca8ad" title="Returns the maximum value for the input field.">maxValue</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _maxValue; }
<a name="l00042"></a><a class="code" href="classIntField.html#a36cbd7c24480cc3fcf0c7634d5e22bf1">00042</a> <span class="keywordtype">void</span> <a class="code" href="classIntField.html#a36cbd7c24480cc3fcf0c7634d5e22bf1" title="Sets the maximum value for the input field.">setMaxValue</a>(<span class="keywordtype">int</span> value) { _maxValue = <a class="code" href="classIntField.html#a2fb650827ce8cb4662253bb6c32acb52" title="Returns the current value of this field.">value</a>; }
<a name="l00043"></a>00043
<a name="l00044"></a><a class="code" href="classIntField.html#a49025ee3473fe066a6a6c546af98bfbd">00044</a> <span class="keywordtype">int</span> <a class="code" href="classIntField.html#a49025ee3473fe066a6a6c546af98bfbd" title="Returns the step value to use when increasing or decreasing the value() due to Up and Down button pre...">stepValue</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _stepValue; }
<a name="l00045"></a><a class="code" href="classIntField.html#a8fb6e207bd906062bb788e19dbe58bcb">00045</a> <span class="keywordtype">void</span> <a class="code" href="classIntField.html#a8fb6e207bd906062bb788e19dbe58bcb" title="Sets the step value value to use when increasing or decreasing the value() due to Up and Down button ...">setStepValue</a>(<span class="keywordtype">int</span> value) { _stepValue = <a class="code" href="classIntField.html#a2fb650827ce8cb4662253bb6c32acb52" title="Returns the current value of this field.">value</a>; }
<a name="l00046"></a>00046
<a name="l00047"></a><a class="code" href="classIntField.html#a2fb650827ce8cb4662253bb6c32acb52">00047</a> <span class="keywordtype">int</span> <a class="code" href="classIntField.html#a2fb650827ce8cb4662253bb6c32acb52" title="Returns the current value of this field.">value</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _value; }
<a name="l00048"></a>00048 <span class="keywordtype">void</span> <a class="code" href="classIntField.html#aed421e2c52946f2c7643534b4f6f13f7" title="Sets the current value of this field.">setValue</a>(<span class="keywordtype">int</span> value);
<a name="l00049"></a>00049
<a name="l00050"></a><a class="code" href="classIntField.html#a1a1de6a1836dfdb820c92b7f188a1b05">00050</a> <span class="keyword">const</span> String &amp;<a class="code" href="classIntField.html#a1a1de6a1836dfdb820c92b7f188a1b05" title="Returns the suffix string to be displayed after the field&#39;s value.">suffix</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _suffix; }
<a name="l00051"></a>00051 <span class="keywordtype">void</span> <a class="code" href="classIntField.html#a9324bba994389f3a4563d9c18bd2f1cd" title="Sets the suffix string to be displayed after the field&#39;s value.">setSuffix</a>(<span class="keyword">const</span> String &amp;suffix);
<a name="l00052"></a>00052
<a name="l00053"></a>00053 <span class="keyword">private</span>:
<a name="l00054"></a>00054 <span class="keywordtype">int</span> _minValue;
<a name="l00055"></a>00055 <span class="keywordtype">int</span> _maxValue;
<a name="l00056"></a>00056 <span class="keywordtype">int</span> _stepValue;
<a name="l00057"></a>00057 <span class="keywordtype">int</span> _value;
<a name="l00058"></a>00058 <span class="keywordtype">int</span> _printLen;
<a name="l00059"></a>00059 String _suffix;
<a name="l00060"></a>00060
<a name="l00061"></a>00061 <span class="keywordtype">void</span> printValue();
<a name="l00062"></a>00062 };
<a name="l00063"></a>00063
<a name="l00064"></a>00064 <span class="preprocessor">#endif</span>
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:49 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

245
LCD_8cpp_source.html Normal file
View File

@ -0,0 +1,245 @@
<!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"/>
<title>ArduinoLibs: LCD.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">LCD.cpp</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;LCD.h&quot;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;avr/pgmspace.h&gt;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#if defined(ARDUINO) &amp;&amp; ARDUINO &gt;= 100</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#include &lt;Arduino.h&gt;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#else</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span><span class="preprocessor">#include &lt;WProgram.h&gt;</span>
<a name="l00029"></a>00029 <span class="preprocessor">#endif</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span>
<a name="l00031"></a>00031 <span class="preprocessor">#define LCD_BACK_LIGHT 3 // LCD backlight is on D3</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span><span class="preprocessor">#define LCD_BUTTON_PIN A0 // Button state is on A0</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span>
<a name="l00034"></a>00034 <span class="preprocessor">#define DEBOUNCE_DELAY 10 // Delay in ms to debounce buttons</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span>
<a name="l00115"></a>00115 <span class="keywordtype">void</span> LCD::init()
<a name="l00116"></a>00116 {
<a name="l00117"></a>00117 <span class="comment">// The Freetronics display is 16x2.</span>
<a name="l00118"></a>00118 begin(16, 2);
<a name="l00119"></a>00119
<a name="l00120"></a>00120 <span class="comment">// Set the LCD back light to be initially on.</span>
<a name="l00121"></a>00121 pinMode(LCD_BACK_LIGHT, OUTPUT);
<a name="l00122"></a>00122 digitalWrite(LCD_BACK_LIGHT, HIGH);
<a name="l00123"></a>00123
<a name="l00124"></a>00124 <span class="comment">// Initialise button input.</span>
<a name="l00125"></a>00125 pinMode(LCD_BUTTON_PIN, INPUT);
<a name="l00126"></a>00126 digitalWrite(LCD_BUTTON_PIN, LOW);
<a name="l00127"></a>00127 prevButton = LCD_BUTTON_NONE;
<a name="l00128"></a>00128 debounceButton = LCD_BUTTON_NONE;
<a name="l00129"></a>00129 lastDebounce = 0;
<a name="l00130"></a>00130 eatRelease = <span class="keyword">false</span>;
<a name="l00131"></a>00131
<a name="l00132"></a>00132 <span class="comment">// Initialize screen saver.</span>
<a name="l00133"></a>00133 timeout = 0;
<a name="l00134"></a>00134 lastRestore = millis();
<a name="l00135"></a>00135 screenSaved = <span class="keyword">false</span>;
<a name="l00136"></a>00136 mode = <a class="code" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28a3f1e62d5fcd314d6ff067d3e74c4bf5f" title="Turn off both the display and the backlight when the screen saver is activated.">DisplayOff</a>;
<a name="l00137"></a>00137 }
<a name="l00138"></a>00138
<a name="l00148"></a><a class="code" href="classLCD.html#a5b07cf05e8e5e7c53654f5ca0cf58b89">00148</a> <span class="keywordtype">void</span> <a class="code" href="classLCD.html#a5b07cf05e8e5e7c53654f5ca0cf58b89" title="Turns on the display of text on the LCD and the back light.">LCD::display</a>()
<a name="l00149"></a>00149 {
<a name="l00150"></a>00150 <a class="code" href="classLCD.html#a5b07cf05e8e5e7c53654f5ca0cf58b89" title="Turns on the display of text on the LCD and the back light.">LiquidCrystal::display</a>();
<a name="l00151"></a>00151 digitalWrite(LCD_BACK_LIGHT, HIGH);
<a name="l00152"></a>00152 screenSaved = <span class="keyword">false</span>;
<a name="l00153"></a>00153 lastRestore = millis();
<a name="l00154"></a>00154 }
<a name="l00155"></a>00155
<a name="l00163"></a><a class="code" href="classLCD.html#af3974da6d988ba2d21c25135ada12108">00163</a> <span class="keywordtype">void</span> <a class="code" href="classLCD.html#af3974da6d988ba2d21c25135ada12108" title="Turns off the display of text on the LCD and the back light.">LCD::noDisplay</a>()
<a name="l00164"></a>00164 {
<a name="l00165"></a>00165 <span class="keywordflow">if</span> (mode == <a class="code" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28a3f1e62d5fcd314d6ff067d3e74c4bf5f" title="Turn off both the display and the backlight when the screen saver is activated.">DisplayOff</a>)
<a name="l00166"></a>00166 <a class="code" href="classLCD.html#af3974da6d988ba2d21c25135ada12108" title="Turns off the display of text on the LCD and the back light.">LiquidCrystal::noDisplay</a>();
<a name="l00167"></a>00167 digitalWrite(LCD_BACK_LIGHT, LOW);
<a name="l00168"></a>00168 screenSaved = <span class="keyword">true</span>;
<a name="l00169"></a>00169 }
<a name="l00170"></a>00170
<a name="l00206"></a><a class="code" href="classLCD.html#a56d1f68532c779c65fbbd071fb444801">00206</a> <span class="keywordtype">void</span> <a class="code" href="classLCD.html#a56d1f68532c779c65fbbd071fb444801" title="Sets the current screen saver mode.">LCD::setScreenSaverMode</a>(<a class="code" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28" title="Screen saver mode that controls the display and back light.">ScreenSaverMode</a> mode)
<a name="l00207"></a>00207 {
<a name="l00208"></a>00208 <span class="keywordflow">if</span> (this-&gt;mode != mode) {
<a name="l00209"></a>00209 this-&gt;mode = mode;
<a name="l00210"></a>00210 <span class="keywordflow">if</span> (screenSaved)
<a name="l00211"></a>00211 <a class="code" href="classLCD.html#af3974da6d988ba2d21c25135ada12108" title="Turns off the display of text on the LCD and the back light.">noDisplay</a>();
<a name="l00212"></a>00212 <span class="keywordflow">else</span>
<a name="l00213"></a>00213 <a class="code" href="classLCD.html#a5b07cf05e8e5e7c53654f5ca0cf58b89" title="Turns on the display of text on the LCD and the back light.">display</a>();
<a name="l00214"></a>00214 }
<a name="l00215"></a>00215 }
<a name="l00216"></a>00216
<a name="l00232"></a><a class="code" href="classLCD.html#af9a2326d034fa159d384ec16223c924f">00232</a> <span class="keywordtype">void</span> <a class="code" href="classLCD.html#af9a2326d034fa159d384ec16223c924f" title="Enables the screen saver and causes it to activate after timeoutSecs of inactivity on the buttons...">LCD::enableScreenSaver</a>(<span class="keywordtype">int</span> timeoutSecs)
<a name="l00233"></a>00233 {
<a name="l00234"></a>00234 <span class="keywordflow">if</span> (timeoutSecs &lt; 0)
<a name="l00235"></a>00235 timeout = 0;
<a name="l00236"></a>00236 <span class="keywordflow">else</span>
<a name="l00237"></a>00237 timeout = ((<span class="keywordtype">unsigned</span> long)timeoutSecs) * 1000;
<a name="l00238"></a>00238 <a class="code" href="classLCD.html#a5b07cf05e8e5e7c53654f5ca0cf58b89" title="Turns on the display of text on the LCD and the back light.">display</a>();
<a name="l00239"></a>00239 }
<a name="l00240"></a>00240
<a name="l00246"></a><a class="code" href="classLCD.html#a85c3a4694b105731404df36e35e5b26e">00246</a> <span class="keywordtype">void</span> <a class="code" href="classLCD.html#a85c3a4694b105731404df36e35e5b26e" title="Disables the screen saver.">LCD::disableScreenSaver</a>()
<a name="l00247"></a>00247 {
<a name="l00248"></a>00248 timeout = 0;
<a name="l00249"></a>00249 <a class="code" href="classLCD.html#a5b07cf05e8e5e7c53654f5ca0cf58b89" title="Turns on the display of text on the LCD and the back light.">display</a>();
<a name="l00250"></a>00250 }
<a name="l00251"></a>00251
<a name="l00259"></a>00259 <span class="comment">// Button mapping table generated by genlookup.c</span>
<a name="l00260"></a>00260 <span class="keyword">static</span> prog_uint8_t <span class="keyword">const</span> buttonMappings[] PROGMEM = {
<a name="l00261"></a>00261 2, 0, 0, 0, 3, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 1,
<a name="l00262"></a>00262 1, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0
<a name="l00263"></a>00263 };
<a name="l00264"></a>00264 <span class="preprocessor">#define mapButton(value) (pgm_read_byte(&amp;(buttonMappings[(value) &gt;&gt; 5])))</span>
<a name="l00265"></a>00265 <span class="preprocessor"></span>
<a name="l00291"></a><a class="code" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292">00291</a> <span class="keywordtype">int</span> <a class="code" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292" title="Gets the next button press, release, or idle event.">LCD::getButton</a>()
<a name="l00292"></a>00292 {
<a name="l00293"></a>00293 <span class="comment">// Read the currently pressed button.</span>
<a name="l00294"></a>00294 <span class="keywordtype">int</span> button = mapButton(analogRead(LCD_BUTTON_PIN));
<a name="l00295"></a>00295
<a name="l00296"></a>00296 <span class="comment">// Debounce the button state.</span>
<a name="l00297"></a>00297 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> currentTime = millis();
<a name="l00298"></a>00298 <span class="keywordflow">if</span> (button != debounceButton)
<a name="l00299"></a>00299 lastDebounce = currentTime;
<a name="l00300"></a>00300 debounceButton = button;
<a name="l00301"></a>00301 <span class="keywordflow">if</span> ((currentTime - lastDebounce) &lt; DEBOUNCE_DELAY)
<a name="l00302"></a>00302 button = prevButton;
<a name="l00303"></a>00303
<a name="l00304"></a>00304 <span class="comment">// Process the button event if the state has changed.</span>
<a name="l00305"></a>00305 <span class="keywordflow">if</span> (prevButton == LCD_BUTTON_NONE &amp;&amp; button != LCD_BUTTON_NONE) {
<a name="l00306"></a>00306 prevButton = button;
<a name="l00307"></a>00307 <span class="keywordflow">if</span> (screenSaved) {
<a name="l00308"></a>00308 <span class="comment">// Button pressed when screen saver active.</span>
<a name="l00309"></a>00309 <span class="keywordflow">if</span> (mode == <a class="code" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28a781f3c5e42506bf4f86ba06d69b23d35" title="Same as BacklightOff but the screen saver is only deactivated when Select is pressed; other buttons h...">BacklightOnSelect</a>) {
<a name="l00310"></a>00310 <span class="comment">// Turn on the back light only if Select was pressed.</span>
<a name="l00311"></a>00311 <span class="keywordflow">if</span> (button == LCD_BUTTON_SELECT) {
<a name="l00312"></a>00312 digitalWrite(LCD_BACK_LIGHT, HIGH);
<a name="l00313"></a>00313 screenSaved = <span class="keyword">false</span>;
<a name="l00314"></a>00314 }
<a name="l00315"></a>00315 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mode == <a class="code" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28a3f1e62d5fcd314d6ff067d3e74c4bf5f" title="Turn off both the display and the backlight when the screen saver is activated.">DisplayOff</a>) {
<a name="l00316"></a>00316 <a class="code" href="classLCD.html#a5b07cf05e8e5e7c53654f5ca0cf58b89" title="Turns on the display of text on the LCD and the back light.">display</a>();
<a name="l00317"></a>00317 eatRelease = <span class="keyword">true</span>;
<a name="l00318"></a>00318 <span class="keywordflow">return</span> LCD_BUTTON_NONE;
<a name="l00319"></a>00319 } <span class="keywordflow">else</span> {
<a name="l00320"></a>00320 <a class="code" href="classLCD.html#a5b07cf05e8e5e7c53654f5ca0cf58b89" title="Turns on the display of text on the LCD and the back light.">display</a>();
<a name="l00321"></a>00321 }
<a name="l00322"></a>00322 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mode == <a class="code" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28a781f3c5e42506bf4f86ba06d69b23d35" title="Same as BacklightOff but the screen saver is only deactivated when Select is pressed; other buttons h...">BacklightOnSelect</a> &amp;&amp; button != LCD_BUTTON_SELECT) {
<a name="l00323"></a>00323 eatRelease = <span class="keyword">false</span>;
<a name="l00324"></a>00324 <span class="keywordflow">return</span> button;
<a name="l00325"></a>00325 }
<a name="l00326"></a>00326 eatRelease = <span class="keyword">false</span>;
<a name="l00327"></a>00327 lastRestore = currentTime;
<a name="l00328"></a>00328 <span class="keywordflow">return</span> button;
<a name="l00329"></a>00329 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (prevButton != LCD_BUTTON_NONE &amp;&amp; button == LCD_BUTTON_NONE) {
<a name="l00330"></a>00330 button = -prevButton;
<a name="l00331"></a>00331 prevButton = LCD_BUTTON_NONE;
<a name="l00332"></a>00332 lastRestore = currentTime;
<a name="l00333"></a>00333 <span class="keywordflow">if</span> (eatRelease) {
<a name="l00334"></a>00334 eatRelease = <span class="keyword">false</span>;
<a name="l00335"></a>00335 <span class="keywordflow">return</span> LCD_BUTTON_NONE;
<a name="l00336"></a>00336 }
<a name="l00337"></a>00337 <span class="keywordflow">return</span> button;
<a name="l00338"></a>00338 } <span class="keywordflow">else</span> {
<a name="l00339"></a>00339 <span class="keywordflow">if</span> (!screenSaved &amp;&amp; prevButton == LCD_BUTTON_NONE &amp;&amp;
<a name="l00340"></a>00340 timeout != 0 &amp;&amp; (currentTime - lastRestore) &gt;= timeout)
<a name="l00341"></a>00341 <a class="code" href="classLCD.html#af3974da6d988ba2d21c25135ada12108" title="Turns off the display of text on the LCD and the back light.">noDisplay</a>(); <span class="comment">// Activate screen saver.</span>
<a name="l00342"></a>00342 <span class="keywordflow">return</span> LCD_BUTTON_NONE;
<a name="l00343"></a>00343 }
<a name="l00344"></a>00344 }
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:49 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

168
LCD_8h_source.html Normal file
View File

@ -0,0 +1,168 @@
<!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"/>
<title>ArduinoLibs: LCD.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">LCD.h</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#ifndef LCD_h</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define LCD_h</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00026"></a>00026 <span class="comment">// Extended version of the LiquidCrystal library that works specifically</span>
<a name="l00027"></a>00027 <span class="comment">// with Freetronics&#39; 16x2 LCD display, including support for the back</span>
<a name="l00028"></a>00028 <span class="comment">// light and the Up/Down/Left/Right/Select buttons. More info:</span>
<a name="l00029"></a>00029 <span class="comment">//</span>
<a name="l00030"></a>00030 <span class="comment">// http://www.freetronics.com/pages/16x2-lcd-shield-quickstart-guide</span>
<a name="l00031"></a>00031
<a name="l00032"></a>00032 <span class="comment">// Include a copy of the standard LiquidCrystal library so we can extend it.</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include &quot;utility/LiquidCrystal.h&quot;</span>
<a name="l00034"></a>00034
<a name="l00035"></a>00035 <span class="comment">// Button event codes.</span>
<a name="l00036"></a>00036 <span class="preprocessor">#define LCD_BUTTON_NONE 0</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor">#define LCD_BUTTON_LEFT 1</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span><span class="preprocessor">#define LCD_BUTTON_RIGHT 2</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor">#define LCD_BUTTON_UP 3</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span><span class="preprocessor">#define LCD_BUTTON_DOWN 4</span>
<a name="l00041"></a>00041 <span class="preprocessor"></span><span class="preprocessor">#define LCD_BUTTON_SELECT 5</span>
<a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#define LCD_BUTTON_LEFT_RELEASED -1</span>
<a name="l00043"></a>00043 <span class="preprocessor"></span><span class="preprocessor">#define LCD_BUTTON_RIGHT_RELEASED -2</span>
<a name="l00044"></a>00044 <span class="preprocessor"></span><span class="preprocessor">#define LCD_BUTTON_UP_RELEASED -3</span>
<a name="l00045"></a>00045 <span class="preprocessor"></span><span class="preprocessor">#define LCD_BUTTON_DOWN_RELEASED -4</span>
<a name="l00046"></a>00046 <span class="preprocessor"></span><span class="preprocessor">#define LCD_BUTTON_SELECT_RELEASED -5</span>
<a name="l00047"></a>00047 <span class="preprocessor"></span>
<a name="l00048"></a><a class="code" href="classLCD.html">00048</a> <span class="keyword">class </span><a class="code" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> : <span class="keyword">public</span> LiquidCrystal {
<a name="l00049"></a>00049 <span class="keyword">public</span>:
<a name="l00050"></a><a class="code" href="classLCD.html#a00bb2db1390721abc7b24ac4b8c276c8">00050</a> <a class="code" href="classLCD.html#a00bb2db1390721abc7b24ac4b8c276c8" title="Initialize the Freetronics LCD display with the default pin assignment.">LCD</a>() : LiquidCrystal(8, 9, 4, 5, 6, 7) { init(); }
<a name="l00051"></a><a class="code" href="classLCD.html#a067bc741cf27f143aba5d9f147908401">00051</a> <a class="code" href="classLCD.html#a067bc741cf27f143aba5d9f147908401" title="Initialize the Freetronics LCD display for USBDroid.">LCD</a>(uint8_t pin9) : LiquidCrystal(8, pin9, 4, 5, 6, 7) { init(); }
<a name="l00052"></a>00052
<a name="l00053"></a>00053 <span class="keywordtype">void</span> <a class="code" href="classLCD.html#a5b07cf05e8e5e7c53654f5ca0cf58b89" title="Turns on the display of text on the LCD and the back light.">display</a>();
<a name="l00054"></a>00054 <span class="keywordtype">void</span> <a class="code" href="classLCD.html#af3974da6d988ba2d21c25135ada12108" title="Turns off the display of text on the LCD and the back light.">noDisplay</a>();
<a name="l00055"></a>00055
<a name="l00056"></a><a class="code" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28">00056</a> <span class="keyword">enum</span> <a class="code" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28" title="Screen saver mode that controls the display and back light.">ScreenSaverMode</a>
<a name="l00057"></a>00057 {
<a name="l00058"></a><a class="code" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28a3f1e62d5fcd314d6ff067d3e74c4bf5f">00058</a> <a class="code" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28a3f1e62d5fcd314d6ff067d3e74c4bf5f" title="Turn off both the display and the backlight when the screen saver is activated.">DisplayOff</a>,
<a name="l00059"></a><a class="code" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28a9931c078cfd1023c69f1da431f9a656c">00059</a> <a class="code" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28a9931c078cfd1023c69f1da431f9a656c" title="Turn off the back light but leave the display on when the screen saver is activated.">BacklightOff</a>,
<a name="l00060"></a><a class="code" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28a781f3c5e42506bf4f86ba06d69b23d35">00060</a> <a class="code" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28a781f3c5e42506bf4f86ba06d69b23d35" title="Same as BacklightOff but the screen saver is only deactivated when Select is pressed; other buttons h...">BacklightOnSelect</a>
<a name="l00061"></a>00061 };
<a name="l00062"></a>00062
<a name="l00063"></a><a class="code" href="classLCD.html#a1917fa285f81f476b4c7cc20d15456b8">00063</a> <a class="code" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28" title="Screen saver mode that controls the display and back light.">ScreenSaverMode</a> <a class="code" href="classLCD.html#a1917fa285f81f476b4c7cc20d15456b8" title="Returns the current screen saver mode; default is DisplayOff.">screenSaverMode</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mode; }
<a name="l00064"></a>00064 <span class="keywordtype">void</span> <a class="code" href="classLCD.html#a56d1f68532c779c65fbbd071fb444801" title="Sets the current screen saver mode.">setScreenSaverMode</a>(<a class="code" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28" title="Screen saver mode that controls the display and back light.">ScreenSaverMode</a> mode);
<a name="l00065"></a>00065
<a name="l00066"></a>00066 <span class="keywordtype">void</span> <a class="code" href="classLCD.html#af9a2326d034fa159d384ec16223c924f" title="Enables the screen saver and causes it to activate after timeoutSecs of inactivity on the buttons...">enableScreenSaver</a>(<span class="keywordtype">int</span> timeoutSecs = 10);
<a name="l00067"></a>00067 <span class="keywordtype">void</span> <a class="code" href="classLCD.html#a85c3a4694b105731404df36e35e5b26e" title="Disables the screen saver.">disableScreenSaver</a>();
<a name="l00068"></a><a class="code" href="classLCD.html#af5d5ca618a3161aa352027b58fe09d0e">00068</a> <span class="keywordtype">bool</span> <a class="code" href="classLCD.html#af5d5ca618a3161aa352027b58fe09d0e" title="Returns true if the screen has been saved; false otherwise.">isScreenSaved</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> screenSaved; }
<a name="l00069"></a>00069
<a name="l00070"></a>00070 <span class="keywordtype">int</span> <a class="code" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292" title="Gets the next button press, release, or idle event.">getButton</a>();
<a name="l00071"></a>00071
<a name="l00072"></a>00072 <span class="keyword">private</span>:
<a name="l00073"></a>00073 <span class="keywordtype">int</span> prevButton;
<a name="l00074"></a>00074 <span class="keywordtype">int</span> debounceButton;
<a name="l00075"></a>00075 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> timeout;
<a name="l00076"></a>00076 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> lastRestore;
<a name="l00077"></a>00077 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> lastDebounce;
<a name="l00078"></a>00078 <span class="keywordtype">bool</span> screenSaved;
<a name="l00079"></a>00079 <span class="keywordtype">bool</span> eatRelease;
<a name="l00080"></a>00080 <a class="code" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28" title="Screen saver mode that controls the display and back light.">ScreenSaverMode</a> mode;
<a name="l00081"></a>00081
<a name="l00082"></a>00082 <span class="keywordtype">void</span> init();
<a name="l00083"></a>00083 };
<a name="l00084"></a>00084
<a name="l00085"></a>00085 <span class="preprocessor">#endif</span>
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:49 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

201
ListField_8cpp_source.html Normal file
View File

@ -0,0 +1,201 @@
<!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"/>
<title>ArduinoLibs: ListField.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">ListField.cpp</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;ListField.h&quot;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;string.h&gt;</span>
<a name="l00025"></a>00025
<a name="l00064"></a><a class="code" href="classListField.html#a118501da7edb0b0bc6b493734975b4e9">00064</a> <a class="code" href="classListField.html#a118501da7edb0b0bc6b493734975b4e9" title="Constructs a new list field with a specific label.">ListField::ListField</a>(<span class="keyword">const</span> String &amp;label)
<a name="l00065"></a>00065 : <a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a>(label)
<a name="l00066"></a>00066 , _items(0)
<a name="l00067"></a>00067 , _itemCount(0)
<a name="l00068"></a>00068 , _value(-1)
<a name="l00069"></a>00069 , _printLen(0)
<a name="l00070"></a>00070 {
<a name="l00071"></a>00071 }
<a name="l00072"></a>00072
<a name="l00077"></a><a class="code" href="classListField.html#aa303898a1f74b52c1c4982653de488b7">00077</a> <a class="code" href="classListField.html#a118501da7edb0b0bc6b493734975b4e9" title="Constructs a new list field with a specific label.">ListField::ListField</a>(<a class="code" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> &amp;form, <span class="keyword">const</span> String &amp;label, ListItems items, <span class="keywordtype">int</span> value)
<a name="l00078"></a>00078 : <a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a>(form, label)
<a name="l00079"></a>00079 , _items(0)
<a name="l00080"></a>00080 , _itemCount(0)
<a name="l00081"></a>00081 , _value(value)
<a name="l00082"></a>00082 , _printLen(0)
<a name="l00083"></a>00083 {
<a name="l00084"></a>00084 <a class="code" href="classListField.html#ae6709bce9355451b651893691456704e" title="Sets the array of items for this list.">setItems</a>(items);
<a name="l00085"></a>00085 }
<a name="l00086"></a>00086
<a name="l00087"></a><a class="code" href="classListField.html#a5d752bd561cde735b175bcdfda55832a">00087</a> <span class="keywordtype">int</span> <a class="code" href="classListField.html#a5d752bd561cde735b175bcdfda55832a" title="Dispatches event via this field.">ListField::dispatch</a>(<span class="keywordtype">int</span> event)
<a name="l00088"></a>00088 {
<a name="l00089"></a>00089 <span class="keywordflow">if</span> (event == LCD_BUTTON_DOWN) {
<a name="l00090"></a>00090 <span class="keywordflow">if</span> (_value &gt;= (_itemCount - 1))
<a name="l00091"></a>00091 <a class="code" href="classListField.html#a266193631e897fb0b46e1270b1d0eb24" title="Sets the value of this list; i.e. the index within items() of the selected item.">setValue</a>(0);
<a name="l00092"></a>00092 <span class="keywordflow">else</span>
<a name="l00093"></a>00093 <a class="code" href="classListField.html#a266193631e897fb0b46e1270b1d0eb24" title="Sets the value of this list; i.e. the index within items() of the selected item.">setValue</a>(_value + 1);
<a name="l00094"></a>00094 <span class="keywordflow">return</span> FORM_CHANGED;
<a name="l00095"></a>00095 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (event == LCD_BUTTON_UP) {
<a name="l00096"></a>00096 <span class="keywordflow">if</span> (_value &lt;= 0)
<a name="l00097"></a>00097 <a class="code" href="classListField.html#a266193631e897fb0b46e1270b1d0eb24" title="Sets the value of this list; i.e. the index within items() of the selected item.">setValue</a>(_itemCount - 1);
<a name="l00098"></a>00098 <span class="keywordflow">else</span>
<a name="l00099"></a>00099 <a class="code" href="classListField.html#a266193631e897fb0b46e1270b1d0eb24" title="Sets the value of this list; i.e. the index within items() of the selected item.">setValue</a>(_value - 1);
<a name="l00100"></a>00100 <span class="keywordflow">return</span> FORM_CHANGED;
<a name="l00101"></a>00101 }
<a name="l00102"></a>00102 <span class="keywordflow">return</span> -1;
<a name="l00103"></a>00103 }
<a name="l00104"></a>00104
<a name="l00105"></a><a class="code" href="classListField.html#a191b79b460e45cf48e04b04eface2888">00105</a> <span class="keywordtype">void</span> <a class="code" href="classListField.html#a191b79b460e45cf48e04b04eface2888" title="Enters the field due to form navigation.">ListField::enterField</a>(<span class="keywordtype">bool</span> reverse)
<a name="l00106"></a>00106 {
<a name="l00107"></a>00107 <a class="code" href="classListField.html#a191b79b460e45cf48e04b04eface2888" title="Enters the field due to form navigation.">Field::enterField</a>(reverse);
<a name="l00108"></a>00108 _printLen = 0;
<a name="l00109"></a>00109 printValue();
<a name="l00110"></a>00110 }
<a name="l00111"></a>00111
<a name="l00141"></a><a class="code" href="classListField.html#ae6709bce9355451b651893691456704e">00141</a> <span class="keywordtype">void</span> <a class="code" href="classListField.html#ae6709bce9355451b651893691456704e" title="Sets the array of items for this list.">ListField::setItems</a>(ListItems items)
<a name="l00142"></a>00142 {
<a name="l00143"></a>00143 _items = <a class="code" href="classListField.html#a4dbbdeebd386551eb8f245b42b45ccf0" title="Returns the array of items in this list.">items</a>;
<a name="l00144"></a>00144 _itemCount = 0;
<a name="l00145"></a>00145 <span class="keywordflow">if</span> (items) {
<a name="l00146"></a>00146 <span class="keywordflow">for</span> (;;) {
<a name="l00147"></a>00147 ListItem item = (ListItem)pgm_read_word(items);
<a name="l00148"></a>00148 <span class="keywordflow">if</span> (!item)
<a name="l00149"></a>00149 <span class="keywordflow">break</span>;
<a name="l00150"></a>00150 ++<a class="code" href="classListField.html#a4dbbdeebd386551eb8f245b42b45ccf0" title="Returns the array of items in this list.">items</a>;
<a name="l00151"></a>00151 ++_itemCount;
<a name="l00152"></a>00152 }
<a name="l00153"></a>00153 }
<a name="l00154"></a>00154 <span class="keywordflow">if</span> (_value &gt;= _itemCount)
<a name="l00155"></a>00155 _value = _itemCount - 1;
<a name="l00156"></a>00156 <span class="keywordflow">if</span> (<a class="code" href="classField.html#a25d86a67b321e8c642edf75a10a35f72" title="Returns true if this field is the currently-displayed field in its owning form; false otherwise...">isCurrent</a>())
<a name="l00157"></a>00157 printValue();
<a name="l00158"></a>00158 }
<a name="l00159"></a>00159
<a name="l00178"></a><a class="code" href="classListField.html#a266193631e897fb0b46e1270b1d0eb24">00178</a> <span class="keywordtype">void</span> <a class="code" href="classListField.html#a266193631e897fb0b46e1270b1d0eb24" title="Sets the value of this list; i.e. the index within items() of the selected item.">ListField::setValue</a>(<span class="keywordtype">int</span> value)
<a name="l00179"></a>00179 {
<a name="l00180"></a>00180 <span class="keywordflow">if</span> (_value != value) {
<a name="l00181"></a>00181 _value = <a class="code" href="classListField.html#aab8477757cd89bacd242c85bac2dccb1" title="Returns the value of this list; i.e. the index within items() of the selected item.">value</a>;
<a name="l00182"></a>00182 <span class="keywordflow">if</span> (_value &lt; 0)
<a name="l00183"></a>00183 _value = 0;
<a name="l00184"></a>00184 <span class="keywordflow">if</span> (_value &gt;= _itemCount)
<a name="l00185"></a>00185 _value = _itemCount - 1;
<a name="l00186"></a>00186 <span class="keywordflow">if</span> (<a class="code" href="classField.html#a25d86a67b321e8c642edf75a10a35f72" title="Returns true if this field is the currently-displayed field in its owning form; false otherwise...">isCurrent</a>())
<a name="l00187"></a>00187 printValue();
<a name="l00188"></a>00188 }
<a name="l00189"></a>00189 }
<a name="l00190"></a>00190
<a name="l00191"></a>00191 <span class="keywordtype">void</span> ListField::printValue()
<a name="l00192"></a>00192 {
<a name="l00193"></a>00193 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;setCursor(0, 1);
<a name="l00194"></a>00194 <span class="keywordtype">int</span> len = 0;
<a name="l00195"></a>00195 <span class="keywordflow">if</span> (_value &gt;= 0) {
<a name="l00196"></a>00196 ListItem str = (ListItem)pgm_read_word(&amp;(_items[_value]));
<a name="l00197"></a>00197 <span class="keywordtype">char</span> ch;
<a name="l00198"></a>00198 <span class="keywordflow">while</span> ((ch = pgm_read_byte(str)) != 0) {
<a name="l00199"></a>00199 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;write(ch);
<a name="l00200"></a>00200 ++len;
<a name="l00201"></a>00201 ++str;
<a name="l00202"></a>00202 }
<a name="l00203"></a>00203 }
<a name="l00204"></a>00204 <span class="keywordflow">while</span> (_printLen-- &gt; len)
<a name="l00205"></a>00205 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;write(<span class="charliteral">&#39; &#39;</span>);
<a name="l00206"></a>00206 _printLen = len;
<a name="l00207"></a>00207 }
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

139
ListField_8h_source.html Normal file
View File

@ -0,0 +1,139 @@
<!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"/>
<title>ArduinoLibs: ListField.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">ListField.h</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#ifndef ListField_h</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define ListField_h</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &quot;Field.h&quot;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;avr/pgmspace.h&gt;</span>
<a name="l00028"></a>00028
<a name="l00029"></a>00029 <span class="keyword">typedef</span> <span class="keyword">const</span> prog_char *ListItem;
<a name="l00030"></a>00030 <span class="keyword">typedef</span> <span class="keyword">const</span> PROGMEM ListItem *ListItems;
<a name="l00031"></a>00031
<a name="l00032"></a><a class="code" href="classListField.html">00032</a> <span class="keyword">class </span><a class="code" href="classListField.html" title="Field that manages selection from a static list of items.">ListField</a> : <span class="keyword">public</span> <a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> {
<a name="l00033"></a>00033 <span class="keyword">public</span>:
<a name="l00034"></a>00034 <span class="keyword">explicit</span> <a class="code" href="classListField.html#a118501da7edb0b0bc6b493734975b4e9" title="Constructs a new list field with a specific label.">ListField</a>(<span class="keyword">const</span> String &amp;<a class="code" href="classField.html#aaa861ef917130c989a955bc75c683afe" title="Returns the label to display in the first line of this field.">label</a>);
<a name="l00035"></a>00035 <a class="code" href="classListField.html#a118501da7edb0b0bc6b493734975b4e9" title="Constructs a new list field with a specific label.">ListField</a>(<a class="code" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> &amp;<a class="code" href="classField.html#a27427319be1cc92db3128637d8884ee5" title="Returns the Form that owns this field; null if not associated with a Form.">form</a>, <span class="keyword">const</span> String &amp;label, ListItems <a class="code" href="classListField.html#a4dbbdeebd386551eb8f245b42b45ccf0" title="Returns the array of items in this list.">items</a>, <span class="keywordtype">int</span> <a class="code" href="classListField.html#aab8477757cd89bacd242c85bac2dccb1" title="Returns the value of this list; i.e. the index within items() of the selected item.">value</a> = 0);
<a name="l00036"></a>00036
<a name="l00037"></a>00037 <span class="keywordtype">int</span> <a class="code" href="classListField.html#a5d752bd561cde735b175bcdfda55832a" title="Dispatches event via this field.">dispatch</a>(<span class="keywordtype">int</span> event);
<a name="l00038"></a>00038
<a name="l00039"></a>00039 <span class="keywordtype">void</span> <a class="code" href="classListField.html#a191b79b460e45cf48e04b04eface2888" title="Enters the field due to form navigation.">enterField</a>(<span class="keywordtype">bool</span> reverse);
<a name="l00040"></a>00040
<a name="l00041"></a><a class="code" href="classListField.html#a4dbbdeebd386551eb8f245b42b45ccf0">00041</a> ListItems <a class="code" href="classListField.html#a4dbbdeebd386551eb8f245b42b45ccf0" title="Returns the array of items in this list.">items</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _items; }
<a name="l00042"></a>00042 <span class="keywordtype">void</span> <a class="code" href="classListField.html#ae6709bce9355451b651893691456704e" title="Sets the array of items for this list.">setItems</a>(ListItems items);
<a name="l00043"></a>00043
<a name="l00044"></a><a class="code" href="classListField.html#aab8477757cd89bacd242c85bac2dccb1">00044</a> <span class="keywordtype">int</span> <a class="code" href="classListField.html#aab8477757cd89bacd242c85bac2dccb1" title="Returns the value of this list; i.e. the index within items() of the selected item.">value</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _value; }
<a name="l00045"></a>00045 <span class="keywordtype">void</span> <a class="code" href="classListField.html#a266193631e897fb0b46e1270b1d0eb24" title="Sets the value of this list; i.e. the index within items() of the selected item.">setValue</a>(<span class="keywordtype">int</span> <a class="code" href="classListField.html#aab8477757cd89bacd242c85bac2dccb1" title="Returns the value of this list; i.e. the index within items() of the selected item.">value</a>);
<a name="l00046"></a>00046
<a name="l00047"></a>00047 <span class="keyword">private</span>:
<a name="l00048"></a>00048 ListItems _items;
<a name="l00049"></a>00049 <span class="keywordtype">int</span> _itemCount;
<a name="l00050"></a>00050 <span class="keywordtype">int</span> _value;
<a name="l00051"></a>00051 <span class="keywordtype">int</span> _printLen;
<a name="l00052"></a>00052
<a name="l00053"></a>00053 <span class="keywordtype">void</span> printValue();
<a name="l00054"></a>00054 };
<a name="l00055"></a>00055
<a name="l00056"></a>00056 <span class="preprocessor">#endif</span>
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

200
Melody_8cpp_source.html Normal file
View File

@ -0,0 +1,200 @@
<!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"/>
<title>ArduinoLibs: Melody.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">Melody.cpp</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;Melody.h&quot;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#if defined(ARDUINO) &amp;&amp; ARDUINO &gt;= 100</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#include &lt;Arduino.h&gt;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#else</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#include &lt;WProgram.h&gt;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#endif</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span>
<a name="l00085"></a><a class="code" href="classMelody.html#a9edc4165a49368dd5d78eedf982c38b9">00085</a> <a class="code" href="classMelody.html#a9edc4165a49368dd5d78eedf982c38b9" title="Constructs a new melody playing object for pin.">Melody::Melody</a>(uint8_t pin)
<a name="l00086"></a>00086 : _pin(pin)
<a name="l00087"></a>00087 , playing(false)
<a name="l00088"></a>00088 , _loopCount(0)
<a name="l00089"></a>00089 , loopsLeft(0)
<a name="l00090"></a>00090 , notes(0)
<a name="l00091"></a>00091 , lengths(0)
<a name="l00092"></a>00092 , size(0)
<a name="l00093"></a>00093 , posn(0)
<a name="l00094"></a>00094 , duration(0)
<a name="l00095"></a>00095 , startNote(0)
<a name="l00096"></a>00096 {
<a name="l00097"></a>00097 }
<a name="l00098"></a>00098
<a name="l00131"></a><a class="code" href="classMelody.html#ae88ad06c2acb728f56dd213d5dad6006">00131</a> <span class="keywordtype">void</span> <a class="code" href="classMelody.html#ae88ad06c2acb728f56dd213d5dad6006" title="Sets the maximum number of loops to last no longer than ms milliseconds.">Melody::setLoopDuration</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> ms)
<a name="l00132"></a>00132 {
<a name="l00133"></a>00133 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> duration = 0;
<a name="l00134"></a>00134 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> index = 0; index &lt; size; ++index)
<a name="l00135"></a>00135 duration += (1000 / lengths[index]) * 13 / 10;
<a name="l00136"></a>00136 _loopCount = (int)(ms / duration);
<a name="l00137"></a>00137 <span class="keywordflow">if</span> (!_loopCount)
<a name="l00138"></a>00138 _loopCount = 1; <span class="comment">// Play the melody at least once.</span>
<a name="l00139"></a>00139 }
<a name="l00140"></a>00140
<a name="l00146"></a><a class="code" href="classMelody.html#a9fd8e0d48833d8da3cd3b3b58408b0b5">00146</a> <span class="keywordtype">void</span> <a class="code" href="classMelody.html#a9fd8e0d48833d8da3cd3b3b58408b0b5" title="Starts playing the melody, or restarts it if already playing.">Melody::play</a>()
<a name="l00147"></a>00147 {
<a name="l00148"></a>00148 <a class="code" href="classMelody.html#ac0c552233c41d85f2766d2e4df376b2b" title="Stops playing the melody.">stop</a>();
<a name="l00149"></a>00149 <span class="keywordflow">if</span> (size == 0)
<a name="l00150"></a>00150 <span class="keywordflow">return</span>; <span class="comment">// No melody to play.</span>
<a name="l00151"></a>00151 loopsLeft = _loopCount;
<a name="l00152"></a>00152 posn = 0;
<a name="l00153"></a>00153 playing = <span class="keyword">true</span>;
<a name="l00154"></a>00154 nextNote();
<a name="l00155"></a>00155 }
<a name="l00156"></a>00156
<a name="l00162"></a><a class="code" href="classMelody.html#aecc9185c9cb1246e8a55521b17d72932">00162</a> <span class="keywordtype">void</span> <a class="code" href="classMelody.html#aecc9185c9cb1246e8a55521b17d72932" title="Plays the melody once and then stops.">Melody::playOnce</a>()
<a name="l00163"></a>00163 {
<a name="l00164"></a>00164 <a class="code" href="classMelody.html#ac0c552233c41d85f2766d2e4df376b2b" title="Stops playing the melody.">stop</a>();
<a name="l00165"></a>00165 <span class="keywordflow">if</span> (size == 0)
<a name="l00166"></a>00166 <span class="keywordflow">return</span>; <span class="comment">// No melody to play.</span>
<a name="l00167"></a>00167 loopsLeft = 1;
<a name="l00168"></a>00168 posn = 0;
<a name="l00169"></a>00169 playing = <span class="keyword">true</span>;
<a name="l00170"></a>00170 nextNote();
<a name="l00171"></a>00171 }
<a name="l00172"></a>00172
<a name="l00178"></a><a class="code" href="classMelody.html#ac0c552233c41d85f2766d2e4df376b2b">00178</a> <span class="keywordtype">void</span> <a class="code" href="classMelody.html#ac0c552233c41d85f2766d2e4df376b2b" title="Stops playing the melody.">Melody::stop</a>()
<a name="l00179"></a>00179 {
<a name="l00180"></a>00180 <span class="keywordflow">if</span> (!playing)
<a name="l00181"></a>00181 <span class="keywordflow">return</span>;
<a name="l00182"></a>00182 playing = <span class="keyword">false</span>;
<a name="l00183"></a>00183 noTone(_pin);
<a name="l00184"></a>00184 }
<a name="l00185"></a>00185
<a name="l00199"></a><a class="code" href="classMelody.html#adb6ad8e8cfe8c9a137e470f4e85c7254">00199</a> <span class="keywordtype">void</span> <a class="code" href="classMelody.html#adb6ad8e8cfe8c9a137e470f4e85c7254" title="Sets the melody to the size elements of notes and lengths.">Melody::setMelody</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> *notes, <span class="keyword">const</span> uint8_t *lengths, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> size)
<a name="l00200"></a>00200 {
<a name="l00201"></a>00201 <a class="code" href="classMelody.html#ac0c552233c41d85f2766d2e4df376b2b" title="Stops playing the melody.">stop</a>();
<a name="l00202"></a>00202 this-&gt;notes = notes;
<a name="l00203"></a>00203 this-&gt;lengths = lengths;
<a name="l00204"></a>00204 this-&gt;size = size;
<a name="l00205"></a>00205 }
<a name="l00206"></a>00206
<a name="l00214"></a><a class="code" href="classMelody.html#ad1103b970be1f59058cc7d927be68955">00214</a> <span class="keywordtype">void</span> <a class="code" href="classMelody.html#ad1103b970be1f59058cc7d927be68955" title="Runs the melody control loop.">Melody::run</a>()
<a name="l00215"></a>00215 {
<a name="l00216"></a>00216 <span class="keywordflow">if</span> (!playing)
<a name="l00217"></a>00217 <span class="keywordflow">return</span>;
<a name="l00218"></a>00218 <span class="keywordflow">if</span> ((millis() - startNote) &gt;= duration) {
<a name="l00219"></a>00219 noTone(_pin);
<a name="l00220"></a>00220 nextNote();
<a name="l00221"></a>00221 }
<a name="l00222"></a>00222 }
<a name="l00223"></a>00223
<a name="l00224"></a>00224 <span class="keywordtype">void</span> Melody::nextNote()
<a name="l00225"></a>00225 {
<a name="l00226"></a>00226 <span class="keywordflow">if</span> (posn &gt;= size) {
<a name="l00227"></a>00227 <span class="keywordflow">if</span> (loopsLeft != 0 &amp;&amp; --loopsLeft &lt;= 0) {
<a name="l00228"></a>00228 <a class="code" href="classMelody.html#ac0c552233c41d85f2766d2e4df376b2b" title="Stops playing the melody.">stop</a>();
<a name="l00229"></a>00229 <span class="keywordflow">return</span>;
<a name="l00230"></a>00230 }
<a name="l00231"></a>00231 posn = 0;
<a name="l00232"></a>00232 }
<a name="l00233"></a>00233 duration = 1000 / lengths[posn];
<a name="l00234"></a>00234 <span class="keywordflow">if</span> (notes[posn] != NOTE_REST)
<a name="l00235"></a>00235 tone(_pin, notes[posn], duration);
<a name="l00236"></a>00236 ++posn;
<a name="l00237"></a>00237 duration = duration * 13 / 10; <span class="comment">// i.e., duration * 1.3</span>
<a name="l00238"></a>00238 startNote = millis();
<a name="l00239"></a>00239 }
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

239
Melody_8h_source.html Normal file
View File

@ -0,0 +1,239 @@
<!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"/>
<title>ArduinoLibs: Melody.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">Melody.h</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#ifndef Melody_h</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define Melody_h</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;inttypes.h&gt;</span>
<a name="l00027"></a>00027
<a name="l00028"></a>00028 <span class="comment">// Note frequencies from http://arduino.cc/en/Tutorial/Tone</span>
<a name="l00029"></a>00029 <span class="preprocessor">#define NOTE_B0 31</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_C1 33</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_CS1 35</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_D1 37</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_DS1 39</span>
<a name="l00034"></a>00034 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_E1 41</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_F1 44</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_FS1 46</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_G1 49</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_GS1 52</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_A1 55</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_AS1 58</span>
<a name="l00041"></a>00041 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_B1 62</span>
<a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_C2 65</span>
<a name="l00043"></a>00043 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_CS2 69</span>
<a name="l00044"></a>00044 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_D2 73</span>
<a name="l00045"></a>00045 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_DS2 78</span>
<a name="l00046"></a>00046 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_E2 82</span>
<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_F2 87</span>
<a name="l00048"></a>00048 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_FS2 93</span>
<a name="l00049"></a>00049 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_G2 98</span>
<a name="l00050"></a>00050 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_GS2 104</span>
<a name="l00051"></a>00051 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_A2 110</span>
<a name="l00052"></a>00052 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_AS2 117</span>
<a name="l00053"></a>00053 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_B2 123</span>
<a name="l00054"></a>00054 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_C3 131</span>
<a name="l00055"></a>00055 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_CS3 139</span>
<a name="l00056"></a>00056 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_D3 147</span>
<a name="l00057"></a>00057 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_DS3 156</span>
<a name="l00058"></a>00058 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_E3 165</span>
<a name="l00059"></a>00059 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_F3 175</span>
<a name="l00060"></a>00060 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_FS3 185</span>
<a name="l00061"></a>00061 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_G3 196</span>
<a name="l00062"></a>00062 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_GS3 208</span>
<a name="l00063"></a>00063 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_A3 220</span>
<a name="l00064"></a>00064 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_AS3 233</span>
<a name="l00065"></a>00065 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_B3 247</span>
<a name="l00066"></a>00066 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_C4 262</span>
<a name="l00067"></a>00067 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_CS4 277</span>
<a name="l00068"></a>00068 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_D4 294</span>
<a name="l00069"></a>00069 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_DS4 311</span>
<a name="l00070"></a>00070 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_E4 330</span>
<a name="l00071"></a>00071 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_F4 349</span>
<a name="l00072"></a>00072 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_FS4 370</span>
<a name="l00073"></a>00073 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_G4 392</span>
<a name="l00074"></a>00074 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_GS4 415</span>
<a name="l00075"></a>00075 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_A4 440</span>
<a name="l00076"></a>00076 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_AS4 466</span>
<a name="l00077"></a>00077 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_B4 494</span>
<a name="l00078"></a>00078 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_C5 523</span>
<a name="l00079"></a>00079 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_CS5 554</span>
<a name="l00080"></a>00080 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_D5 587</span>
<a name="l00081"></a>00081 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_DS5 622</span>
<a name="l00082"></a>00082 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_E5 659</span>
<a name="l00083"></a>00083 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_F5 698</span>
<a name="l00084"></a>00084 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_FS5 740</span>
<a name="l00085"></a>00085 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_G5 784</span>
<a name="l00086"></a>00086 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_GS5 831</span>
<a name="l00087"></a>00087 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_A5 880</span>
<a name="l00088"></a>00088 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_AS5 932</span>
<a name="l00089"></a>00089 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_B5 988</span>
<a name="l00090"></a>00090 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_C6 1047</span>
<a name="l00091"></a>00091 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_CS6 1109</span>
<a name="l00092"></a>00092 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_D6 1175</span>
<a name="l00093"></a>00093 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_DS6 1245</span>
<a name="l00094"></a>00094 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_E6 1319</span>
<a name="l00095"></a>00095 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_F6 1397</span>
<a name="l00096"></a>00096 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_FS6 1480</span>
<a name="l00097"></a>00097 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_G6 1568</span>
<a name="l00098"></a>00098 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_GS6 1661</span>
<a name="l00099"></a>00099 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_A6 1760</span>
<a name="l00100"></a>00100 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_AS6 1865</span>
<a name="l00101"></a>00101 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_B6 1976</span>
<a name="l00102"></a>00102 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_C7 2093</span>
<a name="l00103"></a>00103 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_CS7 2217</span>
<a name="l00104"></a>00104 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_D7 2349</span>
<a name="l00105"></a>00105 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_DS7 2489</span>
<a name="l00106"></a>00106 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_E7 2637</span>
<a name="l00107"></a>00107 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_F7 2794</span>
<a name="l00108"></a>00108 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_FS7 2960</span>
<a name="l00109"></a>00109 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_G7 3136</span>
<a name="l00110"></a>00110 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_GS7 3322</span>
<a name="l00111"></a>00111 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_A7 3520</span>
<a name="l00112"></a>00112 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_AS7 3729</span>
<a name="l00113"></a>00113 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_B7 3951</span>
<a name="l00114"></a>00114 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_C8 4186</span>
<a name="l00115"></a>00115 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_CS8 4435</span>
<a name="l00116"></a>00116 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_D8 4699</span>
<a name="l00117"></a>00117 <span class="preprocessor"></span><span class="preprocessor">#define NOTE_DS8 4978</span>
<a name="l00118"></a>00118 <span class="preprocessor"></span>
<a name="l00119"></a>00119 <span class="comment">// Special note value that indicates a rest.</span>
<a name="l00120"></a>00120 <span class="preprocessor">#define NOTE_REST 0</span>
<a name="l00121"></a>00121 <span class="preprocessor"></span>
<a name="l00122"></a><a class="code" href="classMelody.html">00122</a> <span class="keyword">class </span><a class="code" href="classMelody.html" title="Plays a melody on a digital output pin using tone().">Melody</a> {
<a name="l00123"></a>00123 <span class="keyword">public</span>:
<a name="l00124"></a>00124 <a class="code" href="classMelody.html#a9edc4165a49368dd5d78eedf982c38b9" title="Constructs a new melody playing object for pin.">Melody</a>(uint8_t pin);
<a name="l00125"></a>00125
<a name="l00126"></a><a class="code" href="classMelody.html#ad38db3338ed87d72238c0ea9440c633c">00126</a> <span class="keywordtype">bool</span> <a class="code" href="classMelody.html#ad38db3338ed87d72238c0ea9440c633c" title="Returns true if the melody is currently playing; false if not.">isPlaying</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> playing; }
<a name="l00127"></a>00127
<a name="l00128"></a><a class="code" href="classMelody.html#ab78253ae9abc8478b05f415f5d878a60">00128</a> <span class="keywordtype">int</span> <a class="code" href="classMelody.html#ab78253ae9abc8478b05f415f5d878a60" title="Returns the number of times the melody should loop before stopping.">loopCount</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _loopCount; }
<a name="l00129"></a><a class="code" href="classMelody.html#a507097a2e8ff51a5e9157e3a320ae35b">00129</a> <span class="keywordtype">void</span> <a class="code" href="classMelody.html#a507097a2e8ff51a5e9157e3a320ae35b" title="Sets the number of times the melody should loop to count.">setLoopCount</a>(<span class="keywordtype">int</span> count) { _loopCount = count; }
<a name="l00130"></a>00130
<a name="l00131"></a>00131 <span class="keywordtype">void</span> <a class="code" href="classMelody.html#ae88ad06c2acb728f56dd213d5dad6006" title="Sets the maximum number of loops to last no longer than ms milliseconds.">setLoopDuration</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> ms);
<a name="l00132"></a>00132
<a name="l00133"></a>00133 <span class="keywordtype">void</span> <a class="code" href="classMelody.html#a9fd8e0d48833d8da3cd3b3b58408b0b5" title="Starts playing the melody, or restarts it if already playing.">play</a>();
<a name="l00134"></a>00134 <span class="keywordtype">void</span> <a class="code" href="classMelody.html#aecc9185c9cb1246e8a55521b17d72932" title="Plays the melody once and then stops.">playOnce</a>();
<a name="l00135"></a>00135 <span class="keywordtype">void</span> <a class="code" href="classMelody.html#ac0c552233c41d85f2766d2e4df376b2b" title="Stops playing the melody.">stop</a>();
<a name="l00136"></a>00136
<a name="l00137"></a>00137 <span class="keywordtype">void</span> <a class="code" href="classMelody.html#adb6ad8e8cfe8c9a137e470f4e85c7254" title="Sets the melody to the size elements of notes and lengths.">setMelody</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> *notes, <span class="keyword">const</span> uint8_t *lengths, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> size);
<a name="l00138"></a>00138
<a name="l00139"></a>00139 <span class="keywordtype">void</span> <a class="code" href="classMelody.html#ad1103b970be1f59058cc7d927be68955" title="Runs the melody control loop.">run</a>();
<a name="l00140"></a>00140
<a name="l00141"></a>00141 <span class="keyword">private</span>:
<a name="l00142"></a>00142 uint8_t _pin;
<a name="l00143"></a>00143 <span class="keywordtype">bool</span> playing;
<a name="l00144"></a>00144 <span class="keywordtype">int</span> _loopCount;
<a name="l00145"></a>00145 <span class="keywordtype">int</span> loopsLeft;
<a name="l00146"></a>00146 <span class="keyword">const</span> <span class="keywordtype">int</span> *notes;
<a name="l00147"></a>00147 <span class="keyword">const</span> uint8_t *lengths;
<a name="l00148"></a>00148 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> size;
<a name="l00149"></a>00149 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> posn;
<a name="l00150"></a>00150 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> duration;
<a name="l00151"></a>00151 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> startNote;
<a name="l00152"></a>00152
<a name="l00153"></a>00153 <span class="keywordtype">void</span> nextNote();
<a name="l00154"></a>00154 };
<a name="l00155"></a>00155
<a name="l00156"></a>00156 <span class="preprocessor">#endif</span>
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

145
PowerSave_8cpp_source.html Normal file
View File

@ -0,0 +1,145 @@
<!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"/>
<title>ArduinoLibs: PowerSave.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">PowerSave.cpp</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;PowerSave.h&quot;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;avr/wdt.h&gt;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;avr/sleep.h&gt;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;avr/power.h&gt;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;avr/interrupt.h&gt;</span>
<a name="l00028"></a>00028
<a name="l00036"></a>00036 <span class="comment">/*\@{*/</span>
<a name="l00037"></a>00037
<a name="l00048"></a>00048 ISR(WDT_vect)
<a name="l00049"></a>00049 {
<a name="l00050"></a>00050 wdt_disable();
<a name="l00051"></a>00051 }
<a name="l00132"></a><a class="code" href="group__power__save.html#ga95c1666038493a7f95be6768882eebad">00132</a> <span class="keywordtype">void</span> <a class="code" href="group__power__save.html#ga95c1666038493a7f95be6768882eebad" title="Puts the CPU to sleep for a specific duration.The analog to digital converter and the brown out detec...">sleepFor</a>(<a class="code" href="group__power__save.html#gabdc6266a040b28c4d79028ddb0ceae36" title="Duration to put the CPU to sleep with sleepFor().">SleepDuration</a> duration, uint8_t mode)
<a name="l00133"></a>00133 {
<a name="l00134"></a>00134 <span class="comment">// Turn off the analog to digital converter.</span>
<a name="l00135"></a>00135 ADCSRA &amp;= ~(1 &lt;&lt; ADEN);
<a name="l00136"></a>00136 power_adc_disable();
<a name="l00137"></a>00137
<a name="l00138"></a>00138 <span class="comment">// Turn on the watchdog timer for the desired duration.</span>
<a name="l00139"></a>00139 wdt_enable(duration);
<a name="l00140"></a>00140 WDTCSR |= (1 &lt;&lt; WDIE);
<a name="l00141"></a>00141
<a name="l00142"></a>00142 <span class="comment">// Put the device to sleep, including turning off the Brown Out Detector.</span>
<a name="l00143"></a>00143 set_sleep_mode(mode);
<a name="l00144"></a>00144 cli();
<a name="l00145"></a>00145 sleep_enable();
<a name="l00146"></a>00146 <span class="preprocessor">#if defined(sleep_bod_disable)</span>
<a name="l00147"></a>00147 <span class="preprocessor"></span> sleep_bod_disable();
<a name="l00148"></a>00148 <span class="preprocessor">#endif</span>
<a name="l00149"></a>00149 <span class="preprocessor"></span> sei();
<a name="l00150"></a>00150 sleep_cpu();
<a name="l00151"></a>00151 sleep_disable();
<a name="l00152"></a>00152 sei();
<a name="l00153"></a>00153
<a name="l00154"></a>00154 <span class="comment">// Turn the analog to digital converter back on.</span>
<a name="l00155"></a>00155 power_adc_enable();
<a name="l00156"></a>00156 ADCSRA |= (1 &lt;&lt; ADEN);
<a name="l00157"></a>00157 }
<a name="l00158"></a>00158
<a name="l00159"></a>00159 <span class="comment">/*\@}*/</span>
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

137
PowerSave_8h_source.html Normal file
View File

@ -0,0 +1,137 @@
<!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"/>
<title>ArduinoLibs: PowerSave.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">PowerSave.h</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#ifndef PowerSave_h</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define PowerSave_h</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00026"></a>00026 <span class="preprocessor">#if defined(ARDUINO) &amp;&amp; ARDUINO &gt;= 100</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#include &lt;Arduino.h&gt;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#else</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include &lt;WProgram.h&gt;</span>
<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span>
<a name="l00032"></a><a class="code" href="group__power__save.html#ga6dbe8e20a70e83cf5b068177675ec792">00032</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__power__save.html#ga6dbe8e20a70e83cf5b068177675ec792" title="Marks an I/O pin as unused.This function sets pin to be an input with pullups enabled, which will reduce power consumption compared to pins that are left floating.">unusedPin</a>(uint8_t pin)
<a name="l00033"></a>00033 {
<a name="l00034"></a>00034 pinMode(pin, INPUT);
<a name="l00035"></a>00035 digitalWrite(pin, HIGH);
<a name="l00036"></a>00036 }
<a name="l00037"></a>00037
<a name="l00038"></a><a class="code" href="group__power__save.html#gabdc6266a040b28c4d79028ddb0ceae36">00038</a> <span class="keyword">enum</span> <a class="code" href="group__power__save.html#gabdc6266a040b28c4d79028ddb0ceae36" title="Duration to put the CPU to sleep with sleepFor().">SleepDuration</a>
<a name="l00039"></a>00039 {
<a name="l00040"></a><a class="code" href="group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a3d16487a7386c6348f1c1d886564e3c4">00040</a> <a class="code" href="group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a3d16487a7386c6348f1c1d886564e3c4" title="Sleep for 15 milliseconds.">SLEEP_15_MS</a>,
<a name="l00041"></a><a class="code" href="group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36af31050c5ef733b3e231920143b041825">00041</a> <a class="code" href="group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36af31050c5ef733b3e231920143b041825" title="Sleep for 30 milliseconds.">SLEEP_30_MS</a>,
<a name="l00042"></a><a class="code" href="group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a716f5a9f35e77a2d334ad71f05bd5fdc">00042</a> <a class="code" href="group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a716f5a9f35e77a2d334ad71f05bd5fdc" title="Sleep for 60 milliseconds.">SLEEP_60_MS</a>,
<a name="l00043"></a><a class="code" href="group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a96fa577b54aa6f2341ea5ddd839aa8bc">00043</a> <a class="code" href="group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a96fa577b54aa6f2341ea5ddd839aa8bc" title="Sleep for 120 milliseconds.">SLEEP_120_MS</a>,
<a name="l00044"></a><a class="code" href="group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36abcbf68cfdb688220da61ac98b1a2ec69">00044</a> <a class="code" href="group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36abcbf68cfdb688220da61ac98b1a2ec69" title="Sleep for 250 milliseconds.">SLEEP_250_MS</a>,
<a name="l00045"></a><a class="code" href="group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36aa49e4d5f92a5f48070dde0babf75a9b0">00045</a> <a class="code" href="group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36aa49e4d5f92a5f48070dde0babf75a9b0" title="Sleep for 500 milliseconds.">SLEEP_500_MS</a>,
<a name="l00046"></a><a class="code" href="group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a92310daf29e5899770b80c1c4e850b9b">00046</a> <a class="code" href="group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a92310daf29e5899770b80c1c4e850b9b" title="Sleep for 1 second.">SLEEP_1_SEC</a>,
<a name="l00047"></a><a class="code" href="group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a04571aa0b801c28cd756513303b229cd">00047</a> <a class="code" href="group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a04571aa0b801c28cd756513303b229cd" title="Sleep for 2 seconds.">SLEEP_2_SEC</a>,
<a name="l00048"></a><a class="code" href="group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a4cba1036d7a69225110b68b372f10410">00048</a> <a class="code" href="group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a4cba1036d7a69225110b68b372f10410" title="Sleep for 4 seconds.">SLEEP_4_SEC</a>,
<a name="l00049"></a><a class="code" href="group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a8c47dd1ef81c2f41da7525b5ee4bfc3a">00049</a> <a class="code" href="group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a8c47dd1ef81c2f41da7525b5ee4bfc3a" title="Sleep for 8 seconds.">SLEEP_8_SEC</a>
<a name="l00050"></a>00050 };
<a name="l00051"></a>00051
<a name="l00052"></a>00052 <span class="keywordtype">void</span> <a class="code" href="group__power__save.html#ga95c1666038493a7f95be6768882eebad" title="Puts the CPU to sleep for a specific duration.The analog to digital converter and the brown out detec...">sleepFor</a>(<a class="code" href="group__power__save.html#gabdc6266a040b28c4d79028ddb0ceae36" title="Duration to put the CPU to sleep with sleepFor().">SleepDuration</a> duration, uint8_t mode = 0);
<a name="l00053"></a>00053
<a name="l00054"></a>00054 <span class="preprocessor">#endif</span>
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

305
RTC_8cpp_source.html Normal file
View File

@ -0,0 +1,305 @@
<!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"/>
<title>ArduinoLibs: RTC.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">RTC.cpp</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;RTC.h&quot;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#if defined(ARDUINO) &amp;&amp; ARDUINO &gt;= 100</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#include &lt;Arduino.h&gt;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#else</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#include &lt;WProgram.h&gt;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#endif</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include &lt;stdlib.h&gt;</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include &lt;string.h&gt;</span>
<a name="l00031"></a>00031
<a name="l00058"></a>00058 <span class="preprocessor">#define DEFAULT_BYTE_COUNT 43 // Default simulates DS1307 NVRAM size.</span>
<a name="l00059"></a>00059 <span class="preprocessor"></span>
<a name="l00060"></a>00060 <span class="preprocessor">#define MILLIS_PER_DAY 86400000UL</span>
<a name="l00061"></a>00061 <span class="preprocessor"></span><span class="preprocessor">#define MILLIS_PER_SECOND 1000UL</span>
<a name="l00062"></a>00062 <span class="preprocessor"></span><span class="preprocessor">#define MILLIS_PER_MINUTE 60000UL</span>
<a name="l00063"></a>00063 <span class="preprocessor"></span><span class="preprocessor">#define MILLIS_PER_HOUR 3600000UL</span>
<a name="l00064"></a>00064 <span class="preprocessor"></span>
<a name="l00065"></a>00065 <span class="keyword">static</span> uint8_t monthLengths[] = {
<a name="l00066"></a>00066 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
<a name="l00067"></a>00067 };
<a name="l00068"></a>00068
<a name="l00069"></a>00069 <span class="keyword">inline</span> <span class="keywordtype">bool</span> isLeapYear(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> year)
<a name="l00070"></a>00070 {
<a name="l00071"></a>00071 <span class="keywordflow">if</span> ((year % 100) == 0)
<a name="l00072"></a>00072 <span class="keywordflow">return</span> (year % 400) == 0;
<a name="l00073"></a>00073 <span class="keywordflow">else</span>
<a name="l00074"></a>00074 <span class="keywordflow">return</span> (year % 4) == 0;
<a name="l00075"></a>00075 }
<a name="l00076"></a>00076
<a name="l00077"></a>00077 <span class="keyword">inline</span> uint8_t monthLength(<span class="keyword">const</span> <a class="code" href="structRTCDate.html" title="Stores date information from a realtime clock chip.">RTCDate</a> *date)
<a name="l00078"></a>00078 {
<a name="l00079"></a>00079 <span class="keywordflow">if</span> (date-&gt;<a class="code" href="structRTCDate.html#a6e6196059b36186041a5312400ea9202" title="Month of the year (1-12)">month</a> != 2 || !isLeapYear(date-&gt;<a class="code" href="structRTCDate.html#a7d31822daff3c3fc947386abd897732f" title="Year (4-digit)">year</a>))
<a name="l00080"></a>00080 <span class="keywordflow">return</span> monthLengths[date-&gt;<a class="code" href="structRTCDate.html#a6e6196059b36186041a5312400ea9202" title="Month of the year (1-12)">month</a> - 1];
<a name="l00081"></a>00081 <span class="keywordflow">else</span>
<a name="l00082"></a>00082 <span class="keywordflow">return</span> 29;
<a name="l00083"></a>00083 }
<a name="l00084"></a>00084
<a name="l00090"></a><a class="code" href="classRTC.html#ada31c5120d18d2dd2863b3d440308da2">00090</a> <a class="code" href="classRTC.html#ada31c5120d18d2dd2863b3d440308da2" title="Constructs a new realtime clock handler.">RTC::RTC</a>()
<a name="l00091"></a>00091 : midnight(millis() - 9 * MILLIS_PER_HOUR) <span class="comment">// Simulated clock starts at 9am</span>
<a name="l00092"></a>00092 , nvram(0)
<a name="l00093"></a>00093 {
<a name="l00094"></a>00094 <span class="comment">// Start the simulated date at 1 Jan, 2000.</span>
<a name="l00095"></a>00095 date.<a class="code" href="structRTCDate.html#a2d68ff3fb90240df522b41222362704c" title="Day of the month (1-31)">day</a> = 1;
<a name="l00096"></a>00096 date.<a class="code" href="structRTCDate.html#a6e6196059b36186041a5312400ea9202" title="Month of the year (1-12)">month</a> = 1;
<a name="l00097"></a>00097 date.<a class="code" href="structRTCDate.html#a7d31822daff3c3fc947386abd897732f" title="Year (4-digit)">year</a> = 2000;
<a name="l00098"></a>00098
<a name="l00099"></a>00099 <span class="comment">// Set all simulated alarms to 6am by default.</span>
<a name="l00100"></a>00100 <span class="keywordflow">for</span> (uint8_t index = 0; index &lt; <a class="code" href="classRTC.html#aee5ae8f600ee5296e65635c0d836fca3" title="Number of alarms that are supported by RTC::readAlarm() and RTC::writeAlarm().">ALARM_COUNT</a>; ++index) {
<a name="l00101"></a>00101 alarms[index].<a class="code" href="structRTCAlarm.html#a75bdc42acd3ab3ad495680c6b6a34692" title="Hour of the day for the alarm (0-23).">hour</a> = 6;
<a name="l00102"></a>00102 alarms[index].<a class="code" href="structRTCAlarm.html#ad9a75ceb4b4b3474baa66dd5466e62fe" title="Minute of the hour for the alarm (0-59).">minute</a> = 0;
<a name="l00103"></a>00103 alarms[index].<a class="code" href="structRTCAlarm.html#a0f2ef7363cb60a26642d5295b77ca19e" title="Additional flags for the alarm.">flags</a> = 0;
<a name="l00104"></a>00104 }
<a name="l00105"></a>00105 }
<a name="l00106"></a>00106
<a name="l00107"></a>00107 RTC::~RTC()
<a name="l00108"></a>00108 {
<a name="l00109"></a>00109 <span class="keywordflow">if</span> (nvram)
<a name="l00110"></a>00110 free(nvram);
<a name="l00111"></a>00111 }
<a name="l00112"></a>00112
<a name="l00119"></a><a class="code" href="classRTC.html#a3690761f29654a2c9e676fcbfa32dd30">00119</a> <span class="keywordtype">bool</span> <a class="code" href="classRTC.html#a3690761f29654a2c9e676fcbfa32dd30" title="Returns true if the realtime clock has updated since the last call to this function.">RTC::hasUpdates</a>()
<a name="l00120"></a>00120 {
<a name="l00121"></a>00121 <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00122"></a>00122 }
<a name="l00123"></a>00123
<a name="l00129"></a><a class="code" href="classRTC.html#aaf0a5c1f32f210a49718d148620b5bec">00129</a> <span class="keywordtype">void</span> <a class="code" href="classRTC.html#aaf0a5c1f32f210a49718d148620b5bec" title="Reads the current time from the realtime clock into value.">RTC::readTime</a>(<a class="code" href="structRTCTime.html" title="Stores time information from a realtime clock chip.">RTCTime</a> *value)
<a name="l00130"></a>00130 {
<a name="l00131"></a>00131 <span class="comment">// Determine the number of seconds since the last midnight event.</span>
<a name="l00132"></a>00132 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> sinceMidnight = millis() - midnight;
<a name="l00133"></a>00133 <span class="keywordflow">if</span> (sinceMidnight &gt;= MILLIS_PER_DAY) {
<a name="l00134"></a>00134 <span class="comment">// We have overflowed into the next day. Readjust midnight.</span>
<a name="l00135"></a>00135 midnight += MILLIS_PER_DAY;
<a name="l00136"></a>00136 sinceMidnight -= MILLIS_PER_DAY;
<a name="l00137"></a>00137
<a name="l00138"></a>00138 <span class="comment">// Increment the simulated date.</span>
<a name="l00139"></a>00139 <a class="code" href="classRTC.html#adc29d7c43efc5a192d21965da5c3ee1d" title="Adjusts date up or down one day according to flags.">adjustDays</a>(&amp;date, <a class="code" href="classRTC.html#aacbe3ebbf893685950b05327c11d5c37" title="Increment the day, month, or year in a call to adjustDays(), adjustMonths(), or adjustYears().">INCREMENT</a>);
<a name="l00140"></a>00140 }
<a name="l00141"></a>00141 value-&gt;<a class="code" href="structRTCTime.html#a87b7c02e535d808dcba04c77e34abb91" title="Second within the minute (0-59)">second</a> = (uint8_t)(((sinceMidnight / MILLIS_PER_SECOND) % 60));
<a name="l00142"></a>00142 value-&gt;<a class="code" href="structRTCTime.html#acf2161ca037080dc4b767e636ad8db84" title="Minute within the hour (0-59)">minute</a> = (uint8_t)(((sinceMidnight / MILLIS_PER_MINUTE) % 60));
<a name="l00143"></a>00143 value-&gt;<a class="code" href="structRTCTime.html#a98ba717092ef856dd2b773ba02fcb1a4" title="Hour of the day (0-23)">hour</a> = (uint8_t)(sinceMidnight / MILLIS_PER_HOUR);
<a name="l00144"></a>00144 }
<a name="l00145"></a>00145
<a name="l00154"></a><a class="code" href="classRTC.html#aa1e21bf42ebd4456919744ae0f4f631e">00154</a> <span class="keywordtype">void</span> <a class="code" href="classRTC.html#aa1e21bf42ebd4456919744ae0f4f631e" title="Reads the current date from the realtime clock into value.">RTC::readDate</a>(<a class="code" href="structRTCDate.html" title="Stores date information from a realtime clock chip.">RTCDate</a> *value)
<a name="l00155"></a>00155 {
<a name="l00156"></a>00156 *value = date;
<a name="l00157"></a>00157 }
<a name="l00158"></a>00158
<a name="l00164"></a><a class="code" href="classRTC.html#a102e2ec15bf0273d8f7e9ce4b6dcc96e">00164</a> <span class="keywordtype">void</span> <a class="code" href="classRTC.html#a102e2ec15bf0273d8f7e9ce4b6dcc96e" title="Updates the time in the realtime clock to match value.">RTC::writeTime</a>(<span class="keyword">const</span> <a class="code" href="structRTCTime.html" title="Stores time information from a realtime clock chip.">RTCTime</a> *value)
<a name="l00165"></a>00165 {
<a name="l00166"></a>00166 <span class="comment">// Adjust the position of the last simulated midnight event.</span>
<a name="l00167"></a>00167 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> sinceMidnight =
<a name="l00168"></a>00168 value-&gt;<a class="code" href="structRTCTime.html#a87b7c02e535d808dcba04c77e34abb91" title="Second within the minute (0-59)">second</a> * MILLIS_PER_SECOND +
<a name="l00169"></a>00169 value-&gt;<a class="code" href="structRTCTime.html#acf2161ca037080dc4b767e636ad8db84" title="Minute within the hour (0-59)">minute</a> * MILLIS_PER_MINUTE +
<a name="l00170"></a>00170 value-&gt;<a class="code" href="structRTCTime.html#a98ba717092ef856dd2b773ba02fcb1a4" title="Hour of the day (0-23)">hour</a> * MILLIS_PER_HOUR;
<a name="l00171"></a>00171 midnight = millis() - sinceMidnight;
<a name="l00172"></a>00172 }
<a name="l00173"></a>00173
<a name="l00179"></a><a class="code" href="classRTC.html#ae667600d05c8e7b06a93574dd068a4d7">00179</a> <span class="keywordtype">void</span> <a class="code" href="classRTC.html#ae667600d05c8e7b06a93574dd068a4d7" title="Updates the date in the realtime clock to match value.">RTC::writeDate</a>(<span class="keyword">const</span> <a class="code" href="structRTCDate.html" title="Stores date information from a realtime clock chip.">RTCDate</a> *value)
<a name="l00180"></a>00180 {
<a name="l00181"></a>00181 date = *value;
<a name="l00182"></a>00182 }
<a name="l00183"></a>00183
<a name="l00194"></a><a class="code" href="classRTC.html#ade282d7a60147c3f0269f1fcd59c8d66">00194</a> <span class="keywordtype">void</span> <a class="code" href="classRTC.html#ade282d7a60147c3f0269f1fcd59c8d66" title="Reads the details of the alarm with index alarmNum into value.">RTC::readAlarm</a>(uint8_t alarmNum, <a class="code" href="structRTCAlarm.html" title="Stores alarm information from a realtime clock chip.">RTCAlarm</a> *value)
<a name="l00195"></a>00195 {
<a name="l00196"></a>00196 *value = alarms[alarmNum];
<a name="l00197"></a>00197 }
<a name="l00198"></a>00198
<a name="l00209"></a><a class="code" href="classRTC.html#a0e96c91efd9e7a6340effdae3eadf17e">00209</a> <span class="keywordtype">void</span> <a class="code" href="classRTC.html#a0e96c91efd9e7a6340effdae3eadf17e" title="Updates the details of the alarm with index alarmNum from value.">RTC::writeAlarm</a>(uint8_t alarmNum, <span class="keyword">const</span> <a class="code" href="structRTCAlarm.html" title="Stores alarm information from a realtime clock chip.">RTCAlarm</a> *value)
<a name="l00210"></a>00210 {
<a name="l00211"></a>00211 alarms[alarmNum] = *value;
<a name="l00212"></a>00212 }
<a name="l00213"></a>00213
<a name="l00220"></a><a class="code" href="classRTC.html#acfdebfb449710e44e11f9a3675e14fd8">00220</a> <span class="keywordtype">int</span> <a class="code" href="classRTC.html#acfdebfb449710e44e11f9a3675e14fd8" title="Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings...">RTC::byteCount</a>()<span class="keyword"> const</span>
<a name="l00221"></a>00221 <span class="keyword"></span>{
<a name="l00222"></a>00222 <span class="keywordflow">return</span> DEFAULT_BYTE_COUNT;
<a name="l00223"></a>00223 }
<a name="l00224"></a>00224
<a name="l00232"></a><a class="code" href="classRTC.html#a0f47b10b436e3f9d36e04ec907579431">00232</a> uint8_t <a class="code" href="classRTC.html#a0f47b10b436e3f9d36e04ec907579431" title="Reads the byte at offset within the realtime clock&#39;s non-volatile memory.">RTC::readByte</a>(uint8_t offset)
<a name="l00233"></a>00233 {
<a name="l00234"></a>00234 <span class="keywordflow">if</span> (nvram)
<a name="l00235"></a>00235 <span class="keywordflow">return</span> nvram[offset];
<a name="l00236"></a>00236 <span class="keywordflow">else</span>
<a name="l00237"></a>00237 <span class="keywordflow">return</span> 0;
<a name="l00238"></a>00238 }
<a name="l00239"></a>00239
<a name="l00247"></a><a class="code" href="classRTC.html#a1cab6397ec04b1e2b3feea5b3cd1f749">00247</a> <span class="keywordtype">void</span> <a class="code" href="classRTC.html#a1cab6397ec04b1e2b3feea5b3cd1f749" title="Writes value to offset within the realtime clock&#39;s non-volatile memory.">RTC::writeByte</a>(uint8_t offset, uint8_t value)
<a name="l00248"></a>00248 {
<a name="l00249"></a>00249 <span class="keywordflow">if</span> (nvram) {
<a name="l00250"></a>00250 nvram[offset] = value;
<a name="l00251"></a>00251 } <span class="keywordflow">else</span> {
<a name="l00252"></a>00252 nvram = (uint8_t *)malloc(DEFAULT_BYTE_COUNT);
<a name="l00253"></a>00253 <span class="keywordflow">if</span> (nvram) {
<a name="l00254"></a>00254 memset(nvram, 0, DEFAULT_BYTE_COUNT);
<a name="l00255"></a>00255 nvram[offset] = value;
<a name="l00256"></a>00256 }
<a name="l00257"></a>00257 }
<a name="l00258"></a>00258 }
<a name="l00259"></a>00259
<a name="l00280"></a><a class="code" href="classRTC.html#adc29d7c43efc5a192d21965da5c3ee1d">00280</a> <span class="keywordtype">void</span> <a class="code" href="classRTC.html#adc29d7c43efc5a192d21965da5c3ee1d" title="Adjusts date up or down one day according to flags.">RTC::adjustDays</a>(<a class="code" href="structRTCDate.html" title="Stores date information from a realtime clock chip.">RTCDate</a> *date, uint8_t flags)
<a name="l00281"></a>00281 {
<a name="l00282"></a>00282 <span class="keywordflow">if</span> (flags &amp; <a class="code" href="classRTC.html#a05b1bd1479afc80682abdd4f3e58dc6f" title="Decrement the day, month, or year in a call to adjustDays(), adjustMonths(), or adjustYears().">DECREMENT</a>) {
<a name="l00283"></a>00283 --(date-&gt;<a class="code" href="structRTCDate.html#a2d68ff3fb90240df522b41222362704c" title="Day of the month (1-31)">day</a>);
<a name="l00284"></a>00284 <span class="keywordflow">if</span> (date-&gt;<a class="code" href="structRTCDate.html#a2d68ff3fb90240df522b41222362704c" title="Day of the month (1-31)">day</a> == 0) {
<a name="l00285"></a>00285 <span class="keywordflow">if</span> (!(flags &amp; <a class="code" href="classRTC.html#a02ace2d775063be9a99035851c9274eb" title="Wrap around to the beginning of the current month/year rather than advance to the next one...">WRAP</a>)) {
<a name="l00286"></a>00286 --(date-&gt;<a class="code" href="structRTCDate.html#a6e6196059b36186041a5312400ea9202" title="Month of the year (1-12)">month</a>);
<a name="l00287"></a>00287 <span class="keywordflow">if</span> (date-&gt;<a class="code" href="structRTCDate.html#a6e6196059b36186041a5312400ea9202" title="Month of the year (1-12)">month</a> == 0)
<a name="l00288"></a>00288 date-&gt;<a class="code" href="structRTCDate.html#a6e6196059b36186041a5312400ea9202" title="Month of the year (1-12)">month</a> = 12;
<a name="l00289"></a>00289 }
<a name="l00290"></a>00290 date-&gt;<a class="code" href="structRTCDate.html#a2d68ff3fb90240df522b41222362704c" title="Day of the month (1-31)">day</a> = monthLength(date);
<a name="l00291"></a>00291 }
<a name="l00292"></a>00292 } <span class="keywordflow">else</span> {
<a name="l00293"></a>00293 ++(date-&gt;<a class="code" href="structRTCDate.html#a2d68ff3fb90240df522b41222362704c" title="Day of the month (1-31)">day</a>);
<a name="l00294"></a>00294 <span class="keywordflow">if</span> (date-&gt;<a class="code" href="structRTCDate.html#a2d68ff3fb90240df522b41222362704c" title="Day of the month (1-31)">day</a> &gt; monthLength(date)) {
<a name="l00295"></a>00295 <span class="keywordflow">if</span> (!(flags &amp; <a class="code" href="classRTC.html#a02ace2d775063be9a99035851c9274eb" title="Wrap around to the beginning of the current month/year rather than advance to the next one...">WRAP</a>)) {
<a name="l00296"></a>00296 ++(date-&gt;<a class="code" href="structRTCDate.html#a6e6196059b36186041a5312400ea9202" title="Month of the year (1-12)">month</a>);
<a name="l00297"></a>00297 <span class="keywordflow">if</span> (date-&gt;<a class="code" href="structRTCDate.html#a6e6196059b36186041a5312400ea9202" title="Month of the year (1-12)">month</a> == 13)
<a name="l00298"></a>00298 date-&gt;<a class="code" href="structRTCDate.html#a6e6196059b36186041a5312400ea9202" title="Month of the year (1-12)">month</a> = 1;
<a name="l00299"></a>00299 }
<a name="l00300"></a>00300 date-&gt;<a class="code" href="structRTCDate.html#a2d68ff3fb90240df522b41222362704c" title="Day of the month (1-31)">day</a> = 1;
<a name="l00301"></a>00301 }
<a name="l00302"></a>00302 }
<a name="l00303"></a>00303 }
<a name="l00304"></a>00304
<a name="l00310"></a><a class="code" href="classRTC.html#aeca597e6e37a05716e664242f9cfc5f4">00310</a> <span class="keywordtype">void</span> <a class="code" href="classRTC.html#aeca597e6e37a05716e664242f9cfc5f4" title="Adjusts date up or down one month according to flags.">RTC::adjustMonths</a>(<a class="code" href="structRTCDate.html" title="Stores date information from a realtime clock chip.">RTCDate</a> *date, uint8_t flags)
<a name="l00311"></a>00311 {
<a name="l00312"></a>00312 <span class="keywordflow">if</span> (flags &amp; <a class="code" href="classRTC.html#a05b1bd1479afc80682abdd4f3e58dc6f" title="Decrement the day, month, or year in a call to adjustDays(), adjustMonths(), or adjustYears().">DECREMENT</a>) {
<a name="l00313"></a>00313 --(date-&gt;<a class="code" href="structRTCDate.html#a6e6196059b36186041a5312400ea9202" title="Month of the year (1-12)">month</a>);
<a name="l00314"></a>00314 <span class="keywordflow">if</span> (date-&gt;<a class="code" href="structRTCDate.html#a6e6196059b36186041a5312400ea9202" title="Month of the year (1-12)">month</a> == 0) {
<a name="l00315"></a>00315 date-&gt;<a class="code" href="structRTCDate.html#a6e6196059b36186041a5312400ea9202" title="Month of the year (1-12)">month</a> = 12;
<a name="l00316"></a>00316 <span class="keywordflow">if</span> (!(flags &amp; <a class="code" href="classRTC.html#a02ace2d775063be9a99035851c9274eb" title="Wrap around to the beginning of the current month/year rather than advance to the next one...">WRAP</a>) &amp;&amp; date-&gt;<a class="code" href="structRTCDate.html#a7d31822daff3c3fc947386abd897732f" title="Year (4-digit)">year</a> &gt; 2000)
<a name="l00317"></a>00317 --(date-&gt;<a class="code" href="structRTCDate.html#a7d31822daff3c3fc947386abd897732f" title="Year (4-digit)">year</a>);
<a name="l00318"></a>00318 }
<a name="l00319"></a>00319 } <span class="keywordflow">else</span> {
<a name="l00320"></a>00320 ++(date-&gt;<a class="code" href="structRTCDate.html#a6e6196059b36186041a5312400ea9202" title="Month of the year (1-12)">month</a>);
<a name="l00321"></a>00321 <span class="keywordflow">if</span> (date-&gt;<a class="code" href="structRTCDate.html#a6e6196059b36186041a5312400ea9202" title="Month of the year (1-12)">month</a> == 13) {
<a name="l00322"></a>00322 date-&gt;<a class="code" href="structRTCDate.html#a6e6196059b36186041a5312400ea9202" title="Month of the year (1-12)">month</a> = 1;
<a name="l00323"></a>00323 <span class="keywordflow">if</span> (!(flags &amp; <a class="code" href="classRTC.html#a02ace2d775063be9a99035851c9274eb" title="Wrap around to the beginning of the current month/year rather than advance to the next one...">WRAP</a>) &amp;&amp; date-&gt;<a class="code" href="structRTCDate.html#a7d31822daff3c3fc947386abd897732f" title="Year (4-digit)">year</a> &lt; 2099)
<a name="l00324"></a>00324 ++(date-&gt;<a class="code" href="structRTCDate.html#a7d31822daff3c3fc947386abd897732f" title="Year (4-digit)">year</a>);
<a name="l00325"></a>00325 }
<a name="l00326"></a>00326 }
<a name="l00327"></a>00327 uint8_t len = monthLength(date);
<a name="l00328"></a>00328 <span class="keywordflow">if</span> (date-&gt;<a class="code" href="structRTCDate.html#a2d68ff3fb90240df522b41222362704c" title="Day of the month (1-31)">day</a> &gt; len)
<a name="l00329"></a>00329 date-&gt;<a class="code" href="structRTCDate.html#a2d68ff3fb90240df522b41222362704c" title="Day of the month (1-31)">day</a> = len;
<a name="l00330"></a>00330 }
<a name="l00331"></a>00331
<a name="l00337"></a><a class="code" href="classRTC.html#a31d10cb2f7cac8839bd4be2d858b802d">00337</a> <span class="keywordtype">void</span> <a class="code" href="classRTC.html#a31d10cb2f7cac8839bd4be2d858b802d" title="Adjusts date up or down one year according to flags.">RTC::adjustYears</a>(<a class="code" href="structRTCDate.html" title="Stores date information from a realtime clock chip.">RTCDate</a> *date, uint8_t flags)
<a name="l00338"></a>00338 {
<a name="l00339"></a>00339 <span class="keywordflow">if</span> (flags &amp; <a class="code" href="classRTC.html#a05b1bd1479afc80682abdd4f3e58dc6f" title="Decrement the day, month, or year in a call to adjustDays(), adjustMonths(), or adjustYears().">DECREMENT</a>) {
<a name="l00340"></a>00340 --(date-&gt;<a class="code" href="structRTCDate.html#a7d31822daff3c3fc947386abd897732f" title="Year (4-digit)">year</a>);
<a name="l00341"></a>00341 <span class="keywordflow">if</span> (date-&gt;<a class="code" href="structRTCDate.html#a7d31822daff3c3fc947386abd897732f" title="Year (4-digit)">year</a> &lt; 2000)
<a name="l00342"></a>00342 date-&gt;<a class="code" href="structRTCDate.html#a7d31822daff3c3fc947386abd897732f" title="Year (4-digit)">year</a> = 2000;
<a name="l00343"></a>00343 } <span class="keywordflow">else</span> {
<a name="l00344"></a>00344 ++(date-&gt;<a class="code" href="structRTCDate.html#a7d31822daff3c3fc947386abd897732f" title="Year (4-digit)">year</a>);
<a name="l00345"></a>00345 <span class="keywordflow">if</span> (date-&gt;<a class="code" href="structRTCDate.html#a7d31822daff3c3fc947386abd897732f" title="Year (4-digit)">year</a> &gt; 2099)
<a name="l00346"></a>00346 date-&gt;<a class="code" href="structRTCDate.html#a7d31822daff3c3fc947386abd897732f" title="Year (4-digit)">year</a> = 2099;
<a name="l00347"></a>00347 }
<a name="l00348"></a>00348 uint8_t len = monthLength(date);
<a name="l00349"></a>00349 <span class="keywordflow">if</span> (date-&gt;<a class="code" href="structRTCDate.html#a2d68ff3fb90240df522b41222362704c" title="Day of the month (1-31)">day</a> &gt; len)
<a name="l00350"></a>00350 date-&gt;<a class="code" href="structRTCDate.html#a2d68ff3fb90240df522b41222362704c" title="Day of the month (1-31)">day</a> = len;
<a name="l00351"></a>00351 }
<a name="l00352"></a>00352
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

171
RTC_8h_source.html Normal file
View File

@ -0,0 +1,171 @@
<!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"/>
<title>ArduinoLibs: RTC.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">RTC.h</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#ifndef RTC_h</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define RTC_h</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;inttypes.h&gt;</span>
<a name="l00027"></a>00027
<a name="l00028"></a><a class="code" href="structRTCTime.html">00028</a> <span class="keyword">struct </span><a class="code" href="structRTCTime.html" title="Stores time information from a realtime clock chip.">RTCTime</a>
<a name="l00029"></a>00029 {
<a name="l00030"></a><a class="code" href="structRTCTime.html#a98ba717092ef856dd2b773ba02fcb1a4">00030</a> uint8_t <a class="code" href="structRTCTime.html#a98ba717092ef856dd2b773ba02fcb1a4" title="Hour of the day (0-23)">hour</a>;
<a name="l00031"></a><a class="code" href="structRTCTime.html#acf2161ca037080dc4b767e636ad8db84">00031</a> uint8_t <a class="code" href="structRTCTime.html#acf2161ca037080dc4b767e636ad8db84" title="Minute within the hour (0-59)">minute</a>;
<a name="l00032"></a><a class="code" href="structRTCTime.html#a87b7c02e535d808dcba04c77e34abb91">00032</a> uint8_t <a class="code" href="structRTCTime.html#a87b7c02e535d808dcba04c77e34abb91" title="Second within the minute (0-59)">second</a>;
<a name="l00033"></a>00033 };
<a name="l00034"></a>00034
<a name="l00035"></a><a class="code" href="structRTCDate.html">00035</a> <span class="keyword">struct </span><a class="code" href="structRTCDate.html" title="Stores date information from a realtime clock chip.">RTCDate</a>
<a name="l00036"></a>00036 {
<a name="l00037"></a><a class="code" href="structRTCDate.html#a7d31822daff3c3fc947386abd897732f">00037</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structRTCDate.html#a7d31822daff3c3fc947386abd897732f" title="Year (4-digit)">year</a>;
<a name="l00038"></a><a class="code" href="structRTCDate.html#a6e6196059b36186041a5312400ea9202">00038</a> uint8_t <a class="code" href="structRTCDate.html#a6e6196059b36186041a5312400ea9202" title="Month of the year (1-12)">month</a>;
<a name="l00039"></a><a class="code" href="structRTCDate.html#a2d68ff3fb90240df522b41222362704c">00039</a> uint8_t <a class="code" href="structRTCDate.html#a2d68ff3fb90240df522b41222362704c" title="Day of the month (1-31)">day</a>;
<a name="l00040"></a>00040 };
<a name="l00041"></a>00041
<a name="l00042"></a><a class="code" href="structRTCAlarm.html">00042</a> <span class="keyword">struct </span><a class="code" href="structRTCAlarm.html" title="Stores alarm information from a realtime clock chip.">RTCAlarm</a>
<a name="l00043"></a>00043 {
<a name="l00044"></a><a class="code" href="structRTCAlarm.html#a75bdc42acd3ab3ad495680c6b6a34692">00044</a> uint8_t <a class="code" href="structRTCAlarm.html#a75bdc42acd3ab3ad495680c6b6a34692" title="Hour of the day for the alarm (0-23).">hour</a>;
<a name="l00045"></a><a class="code" href="structRTCAlarm.html#ad9a75ceb4b4b3474baa66dd5466e62fe">00045</a> uint8_t <a class="code" href="structRTCAlarm.html#ad9a75ceb4b4b3474baa66dd5466e62fe" title="Minute of the hour for the alarm (0-59).">minute</a>;
<a name="l00046"></a><a class="code" href="structRTCAlarm.html#a0f2ef7363cb60a26642d5295b77ca19e">00046</a> uint8_t <a class="code" href="structRTCAlarm.html#a0f2ef7363cb60a26642d5295b77ca19e" title="Additional flags for the alarm.">flags</a>;
<a name="l00047"></a>00047 };
<a name="l00048"></a>00048
<a name="l00049"></a><a class="code" href="classRTC.html">00049</a> <span class="keyword">class </span><a class="code" href="classRTC.html" title="Base class for realtime clock handlers.">RTC</a>
<a name="l00050"></a>00050 {
<a name="l00051"></a>00051 <span class="keyword">public</span>:
<a name="l00052"></a>00052 <a class="code" href="classRTC.html#ada31c5120d18d2dd2863b3d440308da2" title="Constructs a new realtime clock handler.">RTC</a>();
<a name="l00053"></a>00053 ~<a class="code" href="classRTC.html" title="Base class for realtime clock handlers.">RTC</a>();
<a name="l00054"></a>00054
<a name="l00055"></a>00055 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classRTC.html#a3690761f29654a2c9e676fcbfa32dd30" title="Returns true if the realtime clock has updated since the last call to this function.">hasUpdates</a>();
<a name="l00056"></a>00056
<a name="l00057"></a>00057 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classRTC.html#aaf0a5c1f32f210a49718d148620b5bec" title="Reads the current time from the realtime clock into value.">readTime</a>(<a class="code" href="structRTCTime.html" title="Stores time information from a realtime clock chip.">RTCTime</a> *value);
<a name="l00058"></a>00058 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classRTC.html#aa1e21bf42ebd4456919744ae0f4f631e" title="Reads the current date from the realtime clock into value.">readDate</a>(<a class="code" href="structRTCDate.html" title="Stores date information from a realtime clock chip.">RTCDate</a> *value);
<a name="l00059"></a>00059
<a name="l00060"></a>00060 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classRTC.html#a102e2ec15bf0273d8f7e9ce4b6dcc96e" title="Updates the time in the realtime clock to match value.">writeTime</a>(<span class="keyword">const</span> <a class="code" href="structRTCTime.html" title="Stores time information from a realtime clock chip.">RTCTime</a> *value);
<a name="l00061"></a>00061 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classRTC.html#ae667600d05c8e7b06a93574dd068a4d7" title="Updates the date in the realtime clock to match value.">writeDate</a>(<span class="keyword">const</span> <a class="code" href="structRTCDate.html" title="Stores date information from a realtime clock chip.">RTCDate</a> *value);
<a name="l00062"></a>00062
<a name="l00063"></a><a class="code" href="classRTC.html#aee5ae8f600ee5296e65635c0d836fca3">00063</a> <span class="keyword">static</span> <span class="keyword">const</span> uint8_t <a class="code" href="classRTC.html#aee5ae8f600ee5296e65635c0d836fca3" title="Number of alarms that are supported by RTC::readAlarm() and RTC::writeAlarm().">ALARM_COUNT</a> = 4;
<a name="l00064"></a>00064
<a name="l00065"></a>00065 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classRTC.html#ade282d7a60147c3f0269f1fcd59c8d66" title="Reads the details of the alarm with index alarmNum into value.">readAlarm</a>(uint8_t alarmNum, <a class="code" href="structRTCAlarm.html" title="Stores alarm information from a realtime clock chip.">RTCAlarm</a> *value);
<a name="l00066"></a>00066 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classRTC.html#a0e96c91efd9e7a6340effdae3eadf17e" title="Updates the details of the alarm with index alarmNum from value.">writeAlarm</a>(uint8_t alarmNum, <span class="keyword">const</span> <a class="code" href="structRTCAlarm.html" title="Stores alarm information from a realtime clock chip.">RTCAlarm</a> *value);
<a name="l00067"></a>00067
<a name="l00068"></a>00068 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classRTC.html#acfdebfb449710e44e11f9a3675e14fd8" title="Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings...">byteCount</a>() <span class="keyword">const</span>;
<a name="l00069"></a>00069 <span class="keyword">virtual</span> uint8_t <a class="code" href="classRTC.html#a0f47b10b436e3f9d36e04ec907579431" title="Reads the byte at offset within the realtime clock&#39;s non-volatile memory.">readByte</a>(uint8_t offset);
<a name="l00070"></a>00070 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classRTC.html#a1cab6397ec04b1e2b3feea5b3cd1f749" title="Writes value to offset within the realtime clock&#39;s non-volatile memory.">writeByte</a>(uint8_t offset, uint8_t value);
<a name="l00071"></a>00071
<a name="l00072"></a>00072 <span class="comment">// Flags for adjustDays(), adjustMonths(), and adjustYears().</span>
<a name="l00073"></a><a class="code" href="classRTC.html#aacbe3ebbf893685950b05327c11d5c37">00073</a> <span class="keyword">static</span> <span class="keyword">const</span> uint8_t <a class="code" href="classRTC.html#aacbe3ebbf893685950b05327c11d5c37" title="Increment the day, month, or year in a call to adjustDays(), adjustMonths(), or adjustYears().">INCREMENT</a> = 0x0000;
<a name="l00074"></a><a class="code" href="classRTC.html#a05b1bd1479afc80682abdd4f3e58dc6f">00074</a> <span class="keyword">static</span> <span class="keyword">const</span> uint8_t <a class="code" href="classRTC.html#a05b1bd1479afc80682abdd4f3e58dc6f" title="Decrement the day, month, or year in a call to adjustDays(), adjustMonths(), or adjustYears().">DECREMENT</a> = 0x0001;
<a name="l00075"></a><a class="code" href="classRTC.html#a02ace2d775063be9a99035851c9274eb">00075</a> <span class="keyword">static</span> <span class="keyword">const</span> uint8_t <a class="code" href="classRTC.html#a02ace2d775063be9a99035851c9274eb" title="Wrap around to the beginning of the current month/year rather than advance to the next one...">WRAP</a> = 0x0002;
<a name="l00076"></a>00076
<a name="l00077"></a>00077 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classRTC.html#adc29d7c43efc5a192d21965da5c3ee1d" title="Adjusts date up or down one day according to flags.">adjustDays</a>(<a class="code" href="structRTCDate.html" title="Stores date information from a realtime clock chip.">RTCDate</a> *date, uint8_t flags);
<a name="l00078"></a>00078 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classRTC.html#aeca597e6e37a05716e664242f9cfc5f4" title="Adjusts date up or down one month according to flags.">adjustMonths</a>(<a class="code" href="structRTCDate.html" title="Stores date information from a realtime clock chip.">RTCDate</a> *date, uint8_t flags);
<a name="l00079"></a>00079 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classRTC.html#a31d10cb2f7cac8839bd4be2d858b802d" title="Adjusts date up or down one year according to flags.">adjustYears</a>(<a class="code" href="structRTCDate.html" title="Stores date information from a realtime clock chip.">RTCDate</a> *date, uint8_t flags);
<a name="l00080"></a>00080
<a name="l00081"></a>00081 <span class="keyword">private</span>:
<a name="l00082"></a>00082 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> midnight;
<a name="l00083"></a>00083 <a class="code" href="structRTCDate.html" title="Stores date information from a realtime clock chip.">RTCDate</a> date;
<a name="l00084"></a>00084 <a class="code" href="structRTCAlarm.html" title="Stores alarm information from a realtime clock chip.">RTCAlarm</a> alarms[<a class="code" href="classRTC.html#aee5ae8f600ee5296e65635c0d836fca3" title="Number of alarms that are supported by RTC::readAlarm() and RTC::writeAlarm().">ALARM_COUNT</a>];
<a name="l00085"></a>00085 uint8_t *nvram;
<a name="l00086"></a>00086 };
<a name="l00087"></a>00087
<a name="l00088"></a>00088 <span class="preprocessor">#endif</span>
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

267
SoftI2C_8cpp_source.html Normal file
View File

@ -0,0 +1,267 @@
<!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"/>
<title>ArduinoLibs: SoftI2C.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">SoftI2C.cpp</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;SoftI2C.h&quot;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#if defined(ARDUINO) &amp;&amp; ARDUINO &gt;= 100</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#include &lt;Arduino.h&gt;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#else</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#include &lt;WProgram.h&gt;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#endif</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span>
<a name="l00045"></a>00045 <span class="preprocessor">#define i2cDelay() delayMicroseconds(5)</span>
<a name="l00046"></a>00046 <span class="preprocessor"></span>
<a name="l00050"></a><a class="code" href="classSoftI2C.html#adb6e00ee3f930f1d32010a18feb5f6cc">00050</a> <a class="code" href="classSoftI2C.html#adb6e00ee3f930f1d32010a18feb5f6cc" title="Constructs a new software I2C master on dataPin and clockPin.">SoftI2C::SoftI2C</a>(uint8_t dataPin, uint8_t clockPin)
<a name="l00051"></a>00051 : _dataPin(dataPin)
<a name="l00052"></a>00052 , _clockPin(clockPin)
<a name="l00053"></a>00053 , started(false)
<a name="l00054"></a>00054 , acked(true)
<a name="l00055"></a>00055 , inWrite(false)
<a name="l00056"></a>00056 , readCount(0)
<a name="l00057"></a>00057 {
<a name="l00058"></a>00058 <span class="comment">// Initially set the CLOCK and DATA lines to be outputs in the high state.</span>
<a name="l00059"></a>00059 pinMode(_clockPin, OUTPUT);
<a name="l00060"></a>00060 pinMode(_dataPin, OUTPUT);
<a name="l00061"></a>00061 digitalWrite(_clockPin, HIGH);
<a name="l00062"></a>00062 digitalWrite(_dataPin, HIGH);
<a name="l00063"></a>00063 }
<a name="l00064"></a>00064
<a name="l00065"></a><a class="code" href="classSoftI2C.html#aad488669f28f6a5a4ceaae3de61d38f4">00065</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classSoftI2C.html#aad488669f28f6a5a4ceaae3de61d38f4" title="Returns the maximum number of bytes that can be read or written in a single request by this bus maste...">SoftI2C::maxTransferSize</a>()<span class="keyword"> const</span>
<a name="l00066"></a>00066 <span class="keyword"></span>{
<a name="l00067"></a>00067 <span class="keywordflow">return</span> 0xFFFF;
<a name="l00068"></a>00068 }
<a name="l00069"></a>00069
<a name="l00070"></a>00070 <span class="keywordtype">void</span> SoftI2C::start()
<a name="l00071"></a>00071 {
<a name="l00072"></a>00072 pinMode(_dataPin, OUTPUT);
<a name="l00073"></a>00073 <span class="keywordflow">if</span> (started) {
<a name="l00074"></a>00074 <span class="comment">// Already started, so send a restart condition.</span>
<a name="l00075"></a>00075 digitalWrite(_dataPin, HIGH);
<a name="l00076"></a>00076 digitalWrite(_clockPin, HIGH);
<a name="l00077"></a>00077 i2cDelay();
<a name="l00078"></a>00078 }
<a name="l00079"></a>00079 digitalWrite(_dataPin, LOW);
<a name="l00080"></a>00080 i2cDelay();
<a name="l00081"></a>00081 digitalWrite(_clockPin, LOW);
<a name="l00082"></a>00082 i2cDelay();
<a name="l00083"></a>00083 started = <span class="keyword">true</span>;
<a name="l00084"></a>00084 acked = <span class="keyword">true</span>;
<a name="l00085"></a>00085 }
<a name="l00086"></a>00086
<a name="l00087"></a>00087 <span class="keywordtype">void</span> SoftI2C::stop()
<a name="l00088"></a>00088 {
<a name="l00089"></a>00089 pinMode(_dataPin, OUTPUT);
<a name="l00090"></a>00090 digitalWrite(_dataPin, LOW);
<a name="l00091"></a>00091 digitalWrite(_clockPin, HIGH);
<a name="l00092"></a>00092 i2cDelay();
<a name="l00093"></a>00093 digitalWrite(_dataPin, HIGH);
<a name="l00094"></a>00094 i2cDelay();
<a name="l00095"></a>00095 started = <span class="keyword">false</span>;
<a name="l00096"></a>00096 inWrite = <span class="keyword">false</span>;
<a name="l00097"></a>00097 }
<a name="l00098"></a>00098
<a name="l00099"></a>00099 <span class="preprocessor">#define I2C_WRITE 0x00</span>
<a name="l00100"></a>00100 <span class="preprocessor"></span><span class="preprocessor">#define I2C_WRITE10 0xF0</span>
<a name="l00101"></a>00101 <span class="preprocessor"></span><span class="preprocessor">#define I2C_READ 0x01</span>
<a name="l00102"></a>00102 <span class="preprocessor"></span><span class="preprocessor">#define I2C_READ10 0xF1</span>
<a name="l00103"></a>00103 <span class="preprocessor"></span>
<a name="l00104"></a><a class="code" href="classSoftI2C.html#aa8a3219f4e6ff52306cc3c219f37d8f9">00104</a> <span class="keywordtype">void</span> <a class="code" href="classSoftI2C.html#aa8a3219f4e6ff52306cc3c219f37d8f9" title="Starts a write operation by sending a start condition and the I2C control byte.">SoftI2C::startWrite</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> address)
<a name="l00105"></a>00105 {
<a name="l00106"></a>00106 start();
<a name="l00107"></a>00107 inWrite = <span class="keyword">true</span>;
<a name="l00108"></a>00108 <span class="keywordflow">if</span> (address &lt; 0x80) {
<a name="l00109"></a>00109 <span class="comment">// 7-bit address.</span>
<a name="l00110"></a>00110 <a class="code" href="classSoftI2C.html#ab46f0b6363c9cfe6fb3ab907956d5d73" title="Writes a single byte value on the I2C bus.">write</a>((uint8_t)((address &lt;&lt; 1) | I2C_WRITE));
<a name="l00111"></a>00111 } <span class="keywordflow">else</span> {
<a name="l00112"></a>00112 <span class="comment">// 10-bit address.</span>
<a name="l00113"></a>00113 <a class="code" href="classSoftI2C.html#ab46f0b6363c9cfe6fb3ab907956d5d73" title="Writes a single byte value on the I2C bus.">write</a>((uint8_t)(((address &gt;&gt; 7) &amp; 0x06)) | I2C_WRITE10);
<a name="l00114"></a>00114 <a class="code" href="classSoftI2C.html#ab46f0b6363c9cfe6fb3ab907956d5d73" title="Writes a single byte value on the I2C bus.">write</a>((uint8_t)address);
<a name="l00115"></a>00115 }
<a name="l00116"></a>00116 }
<a name="l00117"></a>00117
<a name="l00118"></a><a class="code" href="classSoftI2C.html#ab46f0b6363c9cfe6fb3ab907956d5d73">00118</a> <span class="keywordtype">void</span> <a class="code" href="classSoftI2C.html#ab46f0b6363c9cfe6fb3ab907956d5d73" title="Writes a single byte value on the I2C bus.">SoftI2C::write</a>(uint8_t value)
<a name="l00119"></a>00119 {
<a name="l00120"></a>00120 uint8_t mask = 0x80;
<a name="l00121"></a>00121 <span class="keywordflow">while</span> (mask != 0) {
<a name="l00122"></a>00122 writeBit((value &amp; mask) != 0);
<a name="l00123"></a>00123 mask &gt;&gt;= 1;
<a name="l00124"></a>00124 }
<a name="l00125"></a>00125 <span class="keywordflow">if</span> (readBit()) <span class="comment">// 0: ACK, 1: NACK</span>
<a name="l00126"></a>00126 acked = <span class="keyword">false</span>;
<a name="l00127"></a>00127 }
<a name="l00128"></a>00128
<a name="l00129"></a><a class="code" href="classSoftI2C.html#aa12ae82813598b2e9ea70463c23c5bf3">00129</a> <span class="keywordtype">bool</span> <a class="code" href="classSoftI2C.html#aa12ae82813598b2e9ea70463c23c5bf3" title="Ends the current write operation.">SoftI2C::endWrite</a>()
<a name="l00130"></a>00130 {
<a name="l00131"></a>00131 stop();
<a name="l00132"></a>00132 <span class="keywordflow">return</span> acked;
<a name="l00133"></a>00133 }
<a name="l00134"></a>00134
<a name="l00135"></a><a class="code" href="classSoftI2C.html#aa0dafc067cfa374af75e060dca647ec3">00135</a> <span class="keywordtype">bool</span> <a class="code" href="classSoftI2C.html#aa0dafc067cfa374af75e060dca647ec3" title="Starts a read operation for count bytes by sending the start condition and the I2C control byte...">SoftI2C::startRead</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> address, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> count)
<a name="l00136"></a>00136 {
<a name="l00137"></a>00137 start();
<a name="l00138"></a>00138 inWrite = <span class="keyword">false</span>;
<a name="l00139"></a>00139 <span class="keywordflow">if</span> (address &lt; 0x80) {
<a name="l00140"></a>00140 <span class="comment">// 7-bit address.</span>
<a name="l00141"></a>00141 <a class="code" href="classSoftI2C.html#ab46f0b6363c9cfe6fb3ab907956d5d73" title="Writes a single byte value on the I2C bus.">write</a>((uint8_t)((address &lt;&lt; 1) | I2C_READ));
<a name="l00142"></a>00142 } <span class="keywordflow">else</span> {
<a name="l00143"></a>00143 <span class="comment">// 10-bit address.</span>
<a name="l00144"></a>00144 <a class="code" href="classSoftI2C.html#ab46f0b6363c9cfe6fb3ab907956d5d73" title="Writes a single byte value on the I2C bus.">write</a>((uint8_t)(((address &gt;&gt; 7) &amp; 0x06)) | I2C_READ10);
<a name="l00145"></a>00145 <a class="code" href="classSoftI2C.html#ab46f0b6363c9cfe6fb3ab907956d5d73" title="Writes a single byte value on the I2C bus.">write</a>((uint8_t)address);
<a name="l00146"></a>00146 }
<a name="l00147"></a>00147 <span class="keywordflow">if</span> (!acked) {
<a name="l00148"></a>00148 readCount = 0;
<a name="l00149"></a>00149 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00150"></a>00150 }
<a name="l00151"></a>00151 readCount = count;
<a name="l00152"></a>00152 <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00153"></a>00153 }
<a name="l00154"></a>00154
<a name="l00155"></a><a class="code" href="classSoftI2C.html#a849af91018caedbb82e83f02c543305e">00155</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classSoftI2C.html#a849af91018caedbb82e83f02c543305e" title="Returns the number of bytes that are still available for reading.">SoftI2C::available</a>()
<a name="l00156"></a>00156 {
<a name="l00157"></a>00157 <span class="keywordflow">return</span> readCount;
<a name="l00158"></a>00158 }
<a name="l00159"></a>00159
<a name="l00160"></a><a class="code" href="classSoftI2C.html#a330dbba5b726fa161a6b01a9ca49e1bc">00160</a> uint8_t <a class="code" href="classSoftI2C.html#a330dbba5b726fa161a6b01a9ca49e1bc" title="Reads a single byte from the I2C bus.">SoftI2C::read</a>()
<a name="l00161"></a>00161 {
<a name="l00162"></a>00162 uint8_t value = 0;
<a name="l00163"></a>00163 <span class="keywordflow">for</span> (uint8_t bit = 0; bit &lt; 8; ++bit)
<a name="l00164"></a>00164 value = (value &lt;&lt; 1) | readBit();
<a name="l00165"></a>00165 <span class="keywordflow">if</span> (readCount &gt; 1) {
<a name="l00166"></a>00166 <span class="comment">// More bytes left to read - send an ACK.</span>
<a name="l00167"></a>00167 writeBit(<span class="keyword">false</span>);
<a name="l00168"></a>00168 --readCount;
<a name="l00169"></a>00169 } <span class="keywordflow">else</span> {
<a name="l00170"></a>00170 <span class="comment">// Last byte - send the NACK and a stop condition.</span>
<a name="l00171"></a>00171 writeBit(<span class="keyword">true</span>);
<a name="l00172"></a>00172 stop();
<a name="l00173"></a>00173 readCount = 0;
<a name="l00174"></a>00174 }
<a name="l00175"></a>00175 <span class="keywordflow">return</span> value;
<a name="l00176"></a>00176 }
<a name="l00177"></a>00177
<a name="l00178"></a>00178 <span class="keywordtype">void</span> SoftI2C::writeBit(<span class="keywordtype">bool</span> bit)
<a name="l00179"></a>00179 {
<a name="l00180"></a>00180 pinMode(_dataPin, OUTPUT);
<a name="l00181"></a>00181 <span class="keywordflow">if</span> (bit)
<a name="l00182"></a>00182 digitalWrite(_dataPin, HIGH);
<a name="l00183"></a>00183 <span class="keywordflow">else</span>
<a name="l00184"></a>00184 digitalWrite(_dataPin, LOW);
<a name="l00185"></a>00185 i2cDelay();
<a name="l00186"></a>00186 digitalWrite(_clockPin, HIGH);
<a name="l00187"></a>00187 i2cDelay();
<a name="l00188"></a>00188 digitalWrite(_clockPin, LOW);
<a name="l00189"></a>00189 i2cDelay();
<a name="l00190"></a>00190 }
<a name="l00191"></a>00191
<a name="l00192"></a>00192 <span class="keywordtype">bool</span> SoftI2C::readBit()
<a name="l00193"></a>00193 {
<a name="l00194"></a>00194 pinMode(_dataPin, INPUT);
<a name="l00195"></a>00195 digitalWrite(_dataPin, HIGH);
<a name="l00196"></a>00196 digitalWrite(_clockPin, HIGH);
<a name="l00197"></a>00197 <span class="keywordtype">bool</span> bit = digitalRead(_dataPin);
<a name="l00198"></a>00198 i2cDelay();
<a name="l00199"></a>00199 digitalWrite(_clockPin, LOW);
<a name="l00200"></a>00200 i2cDelay();
<a name="l00201"></a>00201 <span class="keywordflow">return</span> bit;
<a name="l00202"></a>00202 }
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

139
SoftI2C_8h_source.html Normal file
View File

@ -0,0 +1,139 @@
<!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"/>
<title>ArduinoLibs: SoftI2C.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">SoftI2C.h</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#ifndef SoftI2C_h</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define SoftI2C_h</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &quot;I2CMaster.h&quot;</span>
<a name="l00027"></a>00027
<a name="l00028"></a><a class="code" href="classSoftI2C.html">00028</a> <span class="keyword">class </span><a class="code" href="classSoftI2C.html" title="Bit-banged implementation of an I2C master.">SoftI2C</a> : <span class="keyword">public</span> <a class="code" href="classI2CMaster.html" title="Abstract base class for I2C master implementations.">I2CMaster</a> {
<a name="l00029"></a>00029 <span class="keyword">public</span>:
<a name="l00030"></a>00030 <a class="code" href="classSoftI2C.html#adb6e00ee3f930f1d32010a18feb5f6cc" title="Constructs a new software I2C master on dataPin and clockPin.">SoftI2C</a>(uint8_t dataPin, uint8_t clockPin);
<a name="l00031"></a>00031
<a name="l00032"></a>00032 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classSoftI2C.html#aad488669f28f6a5a4ceaae3de61d38f4" title="Returns the maximum number of bytes that can be read or written in a single request by this bus maste...">maxTransferSize</a>() <span class="keyword">const</span>;
<a name="l00033"></a>00033
<a name="l00034"></a>00034 <span class="keywordtype">void</span> <a class="code" href="classSoftI2C.html#aa8a3219f4e6ff52306cc3c219f37d8f9" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> address);
<a name="l00035"></a>00035 <span class="keywordtype">void</span> <a class="code" href="classSoftI2C.html#ab46f0b6363c9cfe6fb3ab907956d5d73" title="Writes a single byte value on the I2C bus.">write</a>(uint8_t value);
<a name="l00036"></a>00036 <span class="keywordtype">bool</span> <a class="code" href="classSoftI2C.html#aa12ae82813598b2e9ea70463c23c5bf3" title="Ends the current write operation.">endWrite</a>();
<a name="l00037"></a>00037
<a name="l00038"></a>00038 <span class="keywordtype">bool</span> <a class="code" href="classSoftI2C.html#aa0dafc067cfa374af75e060dca647ec3" title="Starts a read operation for count bytes by sending the start condition and the I2C control byte...">startRead</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> address, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> count);
<a name="l00039"></a>00039 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classSoftI2C.html#a849af91018caedbb82e83f02c543305e" title="Returns the number of bytes that are still available for reading.">available</a>();
<a name="l00040"></a>00040 uint8_t <a class="code" href="classSoftI2C.html#a330dbba5b726fa161a6b01a9ca49e1bc" title="Reads a single byte from the I2C bus.">read</a>();
<a name="l00041"></a>00041
<a name="l00042"></a>00042 <span class="keyword">private</span>:
<a name="l00043"></a>00043 uint8_t _dataPin;
<a name="l00044"></a>00044 uint8_t _clockPin;
<a name="l00045"></a>00045 <span class="keywordtype">bool</span> started;
<a name="l00046"></a>00046 <span class="keywordtype">bool</span> acked;
<a name="l00047"></a>00047 <span class="keywordtype">bool</span> inWrite;
<a name="l00048"></a>00048 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> readCount;
<a name="l00049"></a>00049
<a name="l00050"></a>00050 <span class="keywordtype">void</span> start();
<a name="l00051"></a>00051 <span class="keywordtype">void</span> stop();
<a name="l00052"></a>00052 <span class="keywordtype">void</span> writeBit(<span class="keywordtype">bool</span> bit);
<a name="l00053"></a>00053 <span class="keywordtype">bool</span> readBit();
<a name="l00054"></a>00054 };
<a name="l00055"></a>00055
<a name="l00056"></a>00056 <span class="preprocessor">#endif</span>
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

BIN
StarTrek.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
StarTrekBreadboard.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1019 KiB

BIN
StarTrekShield.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 KiB

139
TextField_8cpp_source.html Normal file
View File

@ -0,0 +1,139 @@
<!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"/>
<title>ArduinoLibs: TextField.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">TextField.cpp</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;TextField.h&quot;</span>
<a name="l00024"></a>00024
<a name="l00066"></a><a class="code" href="classTextField.html#a5108741ab147b2cd5a399fefbe0a2382">00066</a> <a class="code" href="classTextField.html#a5108741ab147b2cd5a399fefbe0a2382" title="Constructs a new text field with a specific label.">TextField::TextField</a>(<span class="keyword">const</span> String &amp;label)
<a name="l00067"></a>00067 : <a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a>(label)
<a name="l00068"></a>00068 {
<a name="l00069"></a>00069 }
<a name="l00070"></a>00070
<a name="l00077"></a><a class="code" href="classTextField.html#a24096a344d9161b2c99ce724ec2ee93c">00077</a> <a class="code" href="classTextField.html#a5108741ab147b2cd5a399fefbe0a2382" title="Constructs a new text field with a specific label.">TextField::TextField</a>(<a class="code" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> &amp;form, <span class="keyword">const</span> String &amp;label, <span class="keyword">const</span> String &amp;value)
<a name="l00078"></a>00078 : <a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a>(form, label)
<a name="l00079"></a>00079 , _value(value)
<a name="l00080"></a>00080 {
<a name="l00081"></a>00081 }
<a name="l00082"></a>00082
<a name="l00083"></a><a class="code" href="classTextField.html#aa78f1354f9240b64fabd6f996e312f32">00083</a> <span class="keywordtype">void</span> <a class="code" href="classTextField.html#aa78f1354f9240b64fabd6f996e312f32" title="Enters the field due to form navigation.">TextField::enterField</a>(<span class="keywordtype">bool</span> reverse)
<a name="l00084"></a>00084 {
<a name="l00085"></a>00085 <a class="code" href="classTextField.html#aa78f1354f9240b64fabd6f996e312f32" title="Enters the field due to form navigation.">Field::enterField</a>(reverse);
<a name="l00086"></a>00086 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;setCursor(0, 1);
<a name="l00087"></a>00087 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;print(_value);
<a name="l00088"></a>00088 }
<a name="l00089"></a>00089
<a name="l00102"></a><a class="code" href="classTextField.html#a24b98c5bb744331bf0a5facc8ea9c033">00102</a> <span class="keywordtype">void</span> <a class="code" href="classTextField.html#a24b98c5bb744331bf0a5facc8ea9c033" title="Sets the text value that is displayed by this field.">TextField::setValue</a>(<span class="keyword">const</span> String &amp;value)
<a name="l00103"></a>00103 {
<a name="l00104"></a>00104 <span class="keywordflow">if</span> (<a class="code" href="classField.html#a25d86a67b321e8c642edf75a10a35f72" title="Returns true if this field is the currently-displayed field in its owning form; false otherwise...">isCurrent</a>()) {
<a name="l00105"></a>00105 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> prevLen = _value.length();
<a name="l00106"></a>00106 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> newLen = value.length();
<a name="l00107"></a>00107 _value = <a class="code" href="classTextField.html#a124764b6fc7c19aaf683f72cd42636b1" title="Returns the text value that is currently displayed by this field.">value</a>;
<a name="l00108"></a>00108 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;setCursor(0, 1);
<a name="l00109"></a>00109 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;print(value);
<a name="l00110"></a>00110 <span class="keywordflow">while</span> (newLen++ &lt; prevLen)
<a name="l00111"></a>00111 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;write(<span class="charliteral">&#39; &#39;</span>);
<a name="l00112"></a>00112 } <span class="keywordflow">else</span> {
<a name="l00113"></a>00113 _value = <a class="code" href="classTextField.html#a124764b6fc7c19aaf683f72cd42636b1" title="Returns the text value that is currently displayed by this field.">value</a>;
<a name="l00114"></a>00114 }
<a name="l00115"></a>00115 }
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

125
TextField_8h_source.html Normal file
View File

@ -0,0 +1,125 @@
<!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"/>
<title>ArduinoLibs: TextField.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">TextField.h</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#ifndef TextField_h</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define TextField_h</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &quot;Field.h&quot;</span>
<a name="l00027"></a>00027
<a name="l00028"></a><a class="code" href="classTextField.html">00028</a> <span class="keyword">class </span><a class="code" href="classTextField.html" title="Field that displays a read-only text value.">TextField</a> : <span class="keyword">public</span> <a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> {
<a name="l00029"></a>00029 <span class="keyword">public</span>:
<a name="l00030"></a>00030 <span class="keyword">explicit</span> <a class="code" href="classTextField.html#a5108741ab147b2cd5a399fefbe0a2382" title="Constructs a new text field with a specific label.">TextField</a>(<span class="keyword">const</span> String &amp;<a class="code" href="classField.html#aaa861ef917130c989a955bc75c683afe" title="Returns the label to display in the first line of this field.">label</a>);
<a name="l00031"></a>00031 <a class="code" href="classTextField.html#a5108741ab147b2cd5a399fefbe0a2382" title="Constructs a new text field with a specific label.">TextField</a>(<a class="code" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> &amp;<a class="code" href="classField.html#a27427319be1cc92db3128637d8884ee5" title="Returns the Form that owns this field; null if not associated with a Form.">form</a>, <span class="keyword">const</span> String &amp;label, <span class="keyword">const</span> String &amp;<a class="code" href="classTextField.html#a124764b6fc7c19aaf683f72cd42636b1" title="Returns the text value that is currently displayed by this field.">value</a>);
<a name="l00032"></a>00032
<a name="l00033"></a>00033 <span class="keywordtype">void</span> <a class="code" href="classTextField.html#aa78f1354f9240b64fabd6f996e312f32" title="Enters the field due to form navigation.">enterField</a>(<span class="keywordtype">bool</span> reverse);
<a name="l00034"></a>00034
<a name="l00035"></a><a class="code" href="classTextField.html#a124764b6fc7c19aaf683f72cd42636b1">00035</a> <span class="keyword">const</span> String &amp;<a class="code" href="classTextField.html#a124764b6fc7c19aaf683f72cd42636b1" title="Returns the text value that is currently displayed by this field.">value</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _value; }
<a name="l00036"></a>00036 <span class="keywordtype">void</span> <a class="code" href="classTextField.html#a24b98c5bb744331bf0a5facc8ea9c033" title="Sets the text value that is displayed by this field.">setValue</a>(<span class="keyword">const</span> String &amp;value);
<a name="l00037"></a>00037
<a name="l00038"></a>00038 <span class="keyword">private</span>:
<a name="l00039"></a>00039 String _value;
<a name="l00040"></a>00040 };
<a name="l00041"></a>00041
<a name="l00042"></a>00042 <span class="preprocessor">#endif</span>
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

BIN
ThreeChase.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

304
TimeField_8cpp_source.html Normal file
View File

@ -0,0 +1,304 @@
<!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"/>
<title>ArduinoLibs: TimeField.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">TimeField.cpp</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;TimeField.h&quot;</span>
<a name="l00024"></a>00024
<a name="l00065"></a>00065 <span class="preprocessor">#define EDIT_HOUR 0</span>
<a name="l00066"></a>00066 <span class="preprocessor"></span><span class="preprocessor">#define EDIT_MINUTE_TENS 1</span>
<a name="l00067"></a>00067 <span class="preprocessor"></span><span class="preprocessor">#define EDIT_MINUTE 2</span>
<a name="l00068"></a>00068 <span class="preprocessor"></span><span class="preprocessor">#define EDIT_SECOND_TENS 3</span>
<a name="l00069"></a>00069 <span class="preprocessor"></span><span class="preprocessor">#define EDIT_SECOND 4</span>
<a name="l00070"></a>00070 <span class="preprocessor"></span>
<a name="l00082"></a><a class="code" href="classTimeField.html#a138e2425379705828a87eb2d8a836431">00082</a> <a class="code" href="classTimeField.html#a138e2425379705828a87eb2d8a836431" title="Constructs a new time field with a specific label.">TimeField::TimeField</a>(<span class="keyword">const</span> String &amp;label)
<a name="l00083"></a>00083 : <a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a>(label)
<a name="l00084"></a>00084 , _value(0)
<a name="l00085"></a>00085 , _maxHours(24)
<a name="l00086"></a>00086 , _printLen(0)
<a name="l00087"></a>00087 , _readOnly(false)
<a name="l00088"></a>00088 , editField(EDIT_HOUR)
<a name="l00089"></a>00089 {
<a name="l00090"></a>00090 }
<a name="l00091"></a>00091
<a name="l00105"></a><a class="code" href="classTimeField.html#a87f222bc098367963ed21a7edc4624de">00105</a> <a class="code" href="classTimeField.html#a138e2425379705828a87eb2d8a836431" title="Constructs a new time field with a specific label.">TimeField::TimeField</a>(<a class="code" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> &amp;form, <span class="keyword">const</span> String &amp;label, <span class="keywordtype">int</span> maxHours, <span class="keywordtype">bool</span> readOnly)
<a name="l00106"></a>00106 : <a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a>(form, label)
<a name="l00107"></a>00107 , _value(0)
<a name="l00108"></a>00108 , _maxHours(maxHours)
<a name="l00109"></a>00109 , _printLen(0)
<a name="l00110"></a>00110 , _readOnly(readOnly)
<a name="l00111"></a>00111 , editField(EDIT_HOUR)
<a name="l00112"></a>00112 {
<a name="l00113"></a>00113 }
<a name="l00114"></a>00114
<a name="l00115"></a><a class="code" href="classTimeField.html#a9b953d9abdbe960a3fa34938462832e5">00115</a> <span class="keywordtype">int</span> <a class="code" href="classTimeField.html#a9b953d9abdbe960a3fa34938462832e5" title="Dispatches event via this field.">TimeField::dispatch</a>(<span class="keywordtype">int</span> event)
<a name="l00116"></a>00116 {
<a name="l00117"></a>00117 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> newValue;
<a name="l00118"></a>00118 <span class="keywordflow">if</span> (_readOnly)
<a name="l00119"></a>00119 <span class="keywordflow">return</span> -1;
<a name="l00120"></a>00120 <span class="keywordflow">if</span> (event == LCD_BUTTON_UP) {
<a name="l00121"></a>00121 newValue = _value;
<a name="l00122"></a>00122 <span class="keywordflow">if</span> (editField == EDIT_HOUR) {
<a name="l00123"></a>00123 newValue += 60 * 60;
<a name="l00124"></a>00124 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (editField == EDIT_MINUTE_TENS) {
<a name="l00125"></a>00125 <span class="keywordflow">if</span> (((newValue / 60) % 60) &gt;= 50)
<a name="l00126"></a>00126 newValue -= 50 * 60;
<a name="l00127"></a>00127 <span class="keywordflow">else</span>
<a name="l00128"></a>00128 newValue += 10 * 60;
<a name="l00129"></a>00129 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (editField == EDIT_MINUTE) {
<a name="l00130"></a>00130 <span class="keywordflow">if</span> (((newValue / 60) % 60) == 59)
<a name="l00131"></a>00131 newValue -= 59 * 60;
<a name="l00132"></a>00132 <span class="keywordflow">else</span>
<a name="l00133"></a>00133 newValue += 60;
<a name="l00134"></a>00134 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (editField == EDIT_SECOND_TENS) {
<a name="l00135"></a>00135 <span class="keywordflow">if</span> ((newValue % 60) &gt;= 50)
<a name="l00136"></a>00136 newValue -= 50;
<a name="l00137"></a>00137 <span class="keywordflow">else</span>
<a name="l00138"></a>00138 newValue += 10;
<a name="l00139"></a>00139 } <span class="keywordflow">else</span> {
<a name="l00140"></a>00140 <span class="keywordflow">if</span> ((newValue % 60) == 59)
<a name="l00141"></a>00141 newValue -= 59;
<a name="l00142"></a>00142 <span class="keywordflow">else</span>
<a name="l00143"></a>00143 newValue += 1;
<a name="l00144"></a>00144 }
<a name="l00145"></a>00145 <a class="code" href="classTimeField.html#a063b6df2bd6fa7970ee445ab4e5d1fc1" title="Sets the value of this time field, in seconds.">setValue</a>(newValue);
<a name="l00146"></a>00146 <span class="keywordflow">return</span> FORM_CHANGED;
<a name="l00147"></a>00147 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (event == LCD_BUTTON_DOWN) {
<a name="l00148"></a>00148 newValue = _value;
<a name="l00149"></a>00149 <span class="keywordflow">if</span> (editField == EDIT_HOUR) {
<a name="l00150"></a>00150 <span class="keywordflow">if</span> (newValue &lt; 60 * 60)
<a name="l00151"></a>00151 newValue += ((<span class="keywordtype">unsigned</span> long)(_maxHours - 1)) * 60 * 60;
<a name="l00152"></a>00152 <span class="keywordflow">else</span>
<a name="l00153"></a>00153 newValue -= 60 * 60;
<a name="l00154"></a>00154 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (editField == EDIT_MINUTE_TENS) {
<a name="l00155"></a>00155 <span class="keywordflow">if</span> (((newValue / 60) % 60) &lt; 10)
<a name="l00156"></a>00156 newValue += 50 * 60;
<a name="l00157"></a>00157 <span class="keywordflow">else</span>
<a name="l00158"></a>00158 newValue -= 10 * 60;
<a name="l00159"></a>00159 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (editField == EDIT_MINUTE) {
<a name="l00160"></a>00160 <span class="keywordflow">if</span> (((newValue / 60) % 60) == 0)
<a name="l00161"></a>00161 newValue += 59 * 60;
<a name="l00162"></a>00162 <span class="keywordflow">else</span>
<a name="l00163"></a>00163 newValue -= 60;
<a name="l00164"></a>00164 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (editField == EDIT_SECOND_TENS) {
<a name="l00165"></a>00165 <span class="keywordflow">if</span> ((newValue % 60) &lt; 10)
<a name="l00166"></a>00166 newValue += 50;
<a name="l00167"></a>00167 <span class="keywordflow">else</span>
<a name="l00168"></a>00168 newValue -= 10;
<a name="l00169"></a>00169 } <span class="keywordflow">else</span> {
<a name="l00170"></a>00170 <span class="keywordflow">if</span> ((newValue % 60) == 0)
<a name="l00171"></a>00171 newValue += 59;
<a name="l00172"></a>00172 <span class="keywordflow">else</span>
<a name="l00173"></a>00173 newValue -= 1;
<a name="l00174"></a>00174 }
<a name="l00175"></a>00175 <a class="code" href="classTimeField.html#a063b6df2bd6fa7970ee445ab4e5d1fc1" title="Sets the value of this time field, in seconds.">setValue</a>(newValue);
<a name="l00176"></a>00176 <span class="keywordflow">return</span> FORM_CHANGED;
<a name="l00177"></a>00177 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (event == LCD_BUTTON_LEFT) {
<a name="l00178"></a>00178 <span class="keywordflow">if</span> (editField != EDIT_HOUR) {
<a name="l00179"></a>00179 --editField;
<a name="l00180"></a>00180 printTime();
<a name="l00181"></a>00181 <span class="keywordflow">return</span> 0;
<a name="l00182"></a>00182 }
<a name="l00183"></a>00183 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (event == LCD_BUTTON_RIGHT) {
<a name="l00184"></a>00184 <span class="keywordflow">if</span> (editField != EDIT_SECOND) {
<a name="l00185"></a>00185 ++editField;
<a name="l00186"></a>00186 printTime();
<a name="l00187"></a>00187 <span class="keywordflow">return</span> 0;
<a name="l00188"></a>00188 }
<a name="l00189"></a>00189 }
<a name="l00190"></a>00190 <span class="keywordflow">return</span> -1;
<a name="l00191"></a>00191 }
<a name="l00192"></a>00192
<a name="l00193"></a><a class="code" href="classTimeField.html#ae914d6b870283a334d2d669460f7646b">00193</a> <span class="keywordtype">void</span> <a class="code" href="classTimeField.html#ae914d6b870283a334d2d669460f7646b" title="Enters the field due to form navigation.">TimeField::enterField</a>(<span class="keywordtype">bool</span> reverse)
<a name="l00194"></a>00194 {
<a name="l00195"></a>00195 <a class="code" href="classTimeField.html#ae914d6b870283a334d2d669460f7646b" title="Enters the field due to form navigation.">Field::enterField</a>(reverse);
<a name="l00196"></a>00196 <span class="keywordflow">if</span> (reverse)
<a name="l00197"></a>00197 editField = EDIT_SECOND;
<a name="l00198"></a>00198 <span class="keywordflow">else</span>
<a name="l00199"></a>00199 editField = EDIT_HOUR;
<a name="l00200"></a>00200 printTime();
<a name="l00201"></a>00201 <span class="keywordflow">if</span> (!_readOnly)
<a name="l00202"></a>00202 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;cursor();
<a name="l00203"></a>00203 }
<a name="l00204"></a>00204
<a name="l00205"></a><a class="code" href="classTimeField.html#a5a6b7db2e3fda7745e0ff9c3d8d9a541">00205</a> <span class="keywordtype">void</span> <a class="code" href="classTimeField.html#a5a6b7db2e3fda7745e0ff9c3d8d9a541" title="Exits the field due to form navigation.">TimeField::exitField</a>()
<a name="l00206"></a>00206 {
<a name="l00207"></a>00207 <span class="keywordflow">if</span> (!_readOnly)
<a name="l00208"></a>00208 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;noCursor();
<a name="l00209"></a>00209 <a class="code" href="classTimeField.html#a5a6b7db2e3fda7745e0ff9c3d8d9a541" title="Exits the field due to form navigation.">Field::exitField</a>();
<a name="l00210"></a>00210 }
<a name="l00211"></a>00211
<a name="l00227"></a><a class="code" href="classTimeField.html#a063b6df2bd6fa7970ee445ab4e5d1fc1">00227</a> <span class="keywordtype">void</span> <a class="code" href="classTimeField.html#a063b6df2bd6fa7970ee445ab4e5d1fc1" title="Sets the value of this time field, in seconds.">TimeField::setValue</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> value)
<a name="l00228"></a>00228 {
<a name="l00229"></a>00229 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> maxSecs = ((<span class="keywordtype">unsigned</span> long)_maxHours) * 60 * 60;
<a name="l00230"></a>00230 value %= maxSecs;
<a name="l00231"></a>00231 <span class="keywordflow">if</span> (value != _value) {
<a name="l00232"></a>00232 _value = <a class="code" href="classTimeField.html#a400aaa72a83b3b872e1de1c3af1a240f" title="Returns the current value of this time field, in seconds.">value</a>;
<a name="l00233"></a>00233 <span class="keywordflow">if</span> (<a class="code" href="classField.html#a25d86a67b321e8c642edf75a10a35f72" title="Returns true if this field is the currently-displayed field in its owning form; false otherwise...">isCurrent</a>())
<a name="l00234"></a>00234 printTime();
<a name="l00235"></a>00235 }
<a name="l00236"></a>00236 }
<a name="l00237"></a>00237
<a name="l00268"></a><a class="code" href="classTimeField.html#a3f002a0729e90e88d04025908be102fe">00268</a> <span class="keywordtype">void</span> <a class="code" href="classTimeField.html#a3f002a0729e90e88d04025908be102fe" title="Sets the read-only state of this field to value.">TimeField::setReadOnly</a>(<span class="keywordtype">bool</span> value)
<a name="l00269"></a>00269 {
<a name="l00270"></a>00270 <span class="keywordflow">if</span> (_readOnly != value) {
<a name="l00271"></a>00271 _readOnly = <a class="code" href="classTimeField.html#a400aaa72a83b3b872e1de1c3af1a240f" title="Returns the current value of this time field, in seconds.">value</a>;
<a name="l00272"></a>00272 printTime();
<a name="l00273"></a>00273 <span class="keywordflow">if</span> (<a class="code" href="classField.html#a25d86a67b321e8c642edf75a10a35f72" title="Returns true if this field is the currently-displayed field in its owning form; false otherwise...">isCurrent</a>()) {
<a name="l00274"></a>00274 <span class="keywordflow">if</span> (value)
<a name="l00275"></a>00275 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;cursor();
<a name="l00276"></a>00276 <span class="keywordflow">else</span>
<a name="l00277"></a>00277 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;noCursor();
<a name="l00278"></a>00278 }
<a name="l00279"></a>00279 }
<a name="l00280"></a>00280 }
<a name="l00281"></a>00281
<a name="l00282"></a>00282 <span class="keywordtype">void</span> TimeField::printTime()
<a name="l00283"></a>00283 {
<a name="l00284"></a>00284 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;setCursor(0, 1);
<a name="l00285"></a>00285 <span class="keywordtype">int</span> col = printField(_value / (60 * 60));
<a name="l00286"></a>00286 <span class="keywordtype">int</span> hourCol = col - 1;
<a name="l00287"></a>00287 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;write(<span class="charliteral">&#39;:&#39;</span>);
<a name="l00288"></a>00288 ++col;
<a name="l00289"></a>00289 col += printField((_value / 60) % 60);
<a name="l00290"></a>00290 <span class="keywordtype">int</span> minuteCol = col - 1;
<a name="l00291"></a>00291 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;write(<span class="charliteral">&#39;:&#39;</span>);
<a name="l00292"></a>00292 ++col;
<a name="l00293"></a>00293 col += printField(_value % 60);
<a name="l00294"></a>00294 <span class="keywordtype">int</span> secondCol = col - 1;
<a name="l00295"></a>00295 <span class="keywordtype">int</span> tempCol = col;
<a name="l00296"></a>00296 <span class="keywordflow">while</span> (tempCol++ &lt; _printLen)
<a name="l00297"></a>00297 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;write(<span class="charliteral">&#39; &#39;</span>);
<a name="l00298"></a>00298 _printLen = col;
<a name="l00299"></a>00299 <span class="keywordflow">if</span> (!_readOnly) {
<a name="l00300"></a>00300 <span class="keywordflow">if</span> (editField == EDIT_HOUR)
<a name="l00301"></a>00301 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;setCursor(hourCol, 1);
<a name="l00302"></a>00302 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (editField == EDIT_MINUTE_TENS)
<a name="l00303"></a>00303 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;setCursor(minuteCol - 1, 1);
<a name="l00304"></a>00304 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (editField == EDIT_MINUTE)
<a name="l00305"></a>00305 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;setCursor(minuteCol, 1);
<a name="l00306"></a>00306 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (editField == EDIT_SECOND_TENS)
<a name="l00307"></a>00307 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;setCursor(secondCol - 1, 1);
<a name="l00308"></a>00308 <span class="keywordflow">else</span>
<a name="l00309"></a>00309 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;setCursor(secondCol, 1);
<a name="l00310"></a>00310 }
<a name="l00311"></a>00311 }
<a name="l00312"></a>00312
<a name="l00313"></a>00313 <span class="keywordtype">int</span> TimeField::printField(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> value)
<a name="l00314"></a>00314 {
<a name="l00315"></a>00315 <span class="keywordflow">if</span> (value &lt; 100) {
<a name="l00316"></a>00316 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;write(<span class="charliteral">&#39;0&#39;</span> + (<span class="keywordtype">int</span>)(value / 10));
<a name="l00317"></a>00317 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;write(<span class="charliteral">&#39;0&#39;</span> + (<span class="keywordtype">int</span>)(value % 10));
<a name="l00318"></a>00318 <span class="keywordflow">return</span> 2;
<a name="l00319"></a>00319 }
<a name="l00320"></a>00320 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> divisor = 100;
<a name="l00321"></a>00321 <span class="keywordflow">while</span> ((value / divisor) &gt;= 10)
<a name="l00322"></a>00322 divisor *= 10;
<a name="l00323"></a>00323 <span class="keywordtype">int</span> digits = 0;
<a name="l00324"></a>00324 <span class="keywordflow">while</span> (divisor &gt; 0) {
<a name="l00325"></a>00325 <a class="code" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1" title="Returns the LCD that this field is being drawn on.">lcd</a>()-&gt;write(<span class="charliteral">&#39;0&#39;</span> + (<span class="keywordtype">int</span>)((value / divisor) % 10));
<a name="l00326"></a>00326 divisor /= 10;
<a name="l00327"></a>00327 ++digits;
<a name="l00328"></a>00328 }
<a name="l00329"></a>00329 <span class="keywordflow">return</span> digits;
<a name="l00330"></a>00330 }
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

144
TimeField_8h_source.html Normal file
View File

@ -0,0 +1,144 @@
<!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"/>
<title>ArduinoLibs: TimeField.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">TimeField.h</div> </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#ifndef TimeField_h</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define TimeField_h</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &quot;Field.h&quot;</span>
<a name="l00027"></a>00027
<a name="l00028"></a>00028 <span class="preprocessor">#define TIMEFIELD_READ_ONLY true</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define TIMEFIELD_READ_WRITE false</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span>
<a name="l00031"></a><a class="code" href="classTimeField.html">00031</a> <span class="keyword">class </span><a class="code" href="classTimeField.html" title="Field that manages the display and editing of a time value.">TimeField</a> : <span class="keyword">public</span> <a class="code" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> {
<a name="l00032"></a>00032 <span class="keyword">public</span>:
<a name="l00033"></a>00033 <span class="keyword">explicit</span> <a class="code" href="classTimeField.html#a138e2425379705828a87eb2d8a836431" title="Constructs a new time field with a specific label.">TimeField</a>(<span class="keyword">const</span> String &amp;<a class="code" href="classField.html#aaa861ef917130c989a955bc75c683afe" title="Returns the label to display in the first line of this field.">label</a>);
<a name="l00034"></a>00034 <a class="code" href="classTimeField.html#a138e2425379705828a87eb2d8a836431" title="Constructs a new time field with a specific label.">TimeField</a>(<a class="code" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> &amp;<a class="code" href="classField.html#a27427319be1cc92db3128637d8884ee5" title="Returns the Form that owns this field; null if not associated with a Form.">form</a>, <span class="keyword">const</span> String &amp;label, <span class="keywordtype">int</span> <a class="code" href="classTimeField.html#aa73f5a62c330ac7d2f647dfe27d026b7" title="Returns the maximum number of hours before the field wraps around.">maxHours</a>, <span class="keywordtype">bool</span> <a class="code" href="classTimeField.html#aa0795c873ba9941c8a1a3bf8c06668f1" title="Returns TIMEFIELD_READ_ONLY (true) or TIMEFIELD_READ_WRITE (false).">readOnly</a>);
<a name="l00035"></a>00035
<a name="l00036"></a>00036 <span class="keywordtype">int</span> <a class="code" href="classTimeField.html#a9b953d9abdbe960a3fa34938462832e5" title="Dispatches event via this field.">dispatch</a>(<span class="keywordtype">int</span> event);
<a name="l00037"></a>00037
<a name="l00038"></a>00038 <span class="keywordtype">void</span> <a class="code" href="classTimeField.html#ae914d6b870283a334d2d669460f7646b" title="Enters the field due to form navigation.">enterField</a>(<span class="keywordtype">bool</span> reverse);
<a name="l00039"></a>00039 <span class="keywordtype">void</span> <a class="code" href="classTimeField.html#a5a6b7db2e3fda7745e0ff9c3d8d9a541" title="Exits the field due to form navigation.">exitField</a>();
<a name="l00040"></a>00040
<a name="l00041"></a><a class="code" href="classTimeField.html#a400aaa72a83b3b872e1de1c3af1a240f">00041</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="classTimeField.html#a400aaa72a83b3b872e1de1c3af1a240f" title="Returns the current value of this time field, in seconds.">value</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _value; }
<a name="l00042"></a>00042 <span class="keywordtype">void</span> <a class="code" href="classTimeField.html#a063b6df2bd6fa7970ee445ab4e5d1fc1" title="Sets the value of this time field, in seconds.">setValue</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="classTimeField.html#a400aaa72a83b3b872e1de1c3af1a240f" title="Returns the current value of this time field, in seconds.">value</a>);
<a name="l00043"></a>00043
<a name="l00044"></a><a class="code" href="classTimeField.html#aa73f5a62c330ac7d2f647dfe27d026b7">00044</a> <span class="keywordtype">int</span> <a class="code" href="classTimeField.html#aa73f5a62c330ac7d2f647dfe27d026b7" title="Returns the maximum number of hours before the field wraps around.">maxHours</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _maxHours; }
<a name="l00045"></a><a class="code" href="classTimeField.html#a7ac124eb9dde01c18c711c421736b5ed">00045</a> <span class="keywordtype">void</span> <a class="code" href="classTimeField.html#a7ac124eb9dde01c18c711c421736b5ed" title="Sets the maximum number of hours before the field wraps around to maxHours.">setMaxHours</a>(<span class="keywordtype">int</span> maxHours) { _maxHours = <a class="code" href="classTimeField.html#aa73f5a62c330ac7d2f647dfe27d026b7" title="Returns the maximum number of hours before the field wraps around.">maxHours</a>; }
<a name="l00046"></a>00046
<a name="l00047"></a><a class="code" href="classTimeField.html#aa0795c873ba9941c8a1a3bf8c06668f1">00047</a> <span class="keywordtype">bool</span> <a class="code" href="classTimeField.html#aa0795c873ba9941c8a1a3bf8c06668f1" title="Returns TIMEFIELD_READ_ONLY (true) or TIMEFIELD_READ_WRITE (false).">readOnly</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _readOnly; }
<a name="l00048"></a>00048 <span class="keywordtype">void</span> <a class="code" href="classTimeField.html#a3f002a0729e90e88d04025908be102fe" title="Sets the read-only state of this field to value.">setReadOnly</a>(<span class="keywordtype">bool</span> <a class="code" href="classTimeField.html#a400aaa72a83b3b872e1de1c3af1a240f" title="Returns the current value of this time field, in seconds.">value</a>);
<a name="l00049"></a>00049
<a name="l00050"></a>00050 <span class="keyword">private</span>:
<a name="l00051"></a>00051 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> _value;
<a name="l00052"></a>00052 <span class="keywordtype">int</span> _maxHours;
<a name="l00053"></a>00053 <span class="keywordtype">int</span> _printLen;
<a name="l00054"></a>00054 <span class="keywordtype">bool</span> _readOnly;
<a name="l00055"></a>00055 uint8_t editField;
<a name="l00056"></a>00056
<a name="l00057"></a>00057 <span class="keywordtype">void</span> printTime();
<a name="l00058"></a>00058 <span class="keywordtype">int</span> printField(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="classTimeField.html#a400aaa72a83b3b872e1de1c3af1a240f" title="Returns the current value of this time field, in seconds.">value</a>);
<a name="l00059"></a>00059 };
<a name="l00060"></a>00060
<a name="l00061"></a>00061 <span class="preprocessor">#endif</span>
</pre></div></div>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

88
alarm-clock_8dox.html Normal file
View File

@ -0,0 +1,88 @@
<!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"/>
<title>ArduinoLibs: alarm-clock.dox File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">alarm-clock.dox File Reference</div> </div>
</div>
<div class="contents">
<table class="memberdecls">
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock">
<p>Definition in file <a class="el" href="alarm-clock_8dox_source.html">alarm-clock.dox</a>.</p>
</div></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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

BIN
alarm_circuit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

120
alarm_clock.html Normal file
View File

@ -0,0 +1,120 @@
<!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"/>
<title>ArduinoLibs: Alarm Clock</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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>
<div class="header">
<div class="headertitle">
<div class="title">Alarm Clock </div> </div>
</div>
<div class="contents">
<div class="textblock"><h2><a class="anchor" id="clock_features"></a>
Features</h2>
<p>The alarm clock described on this page is a large example application that uses many of the classes in the provided libraries: <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a>, <a class="el" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a>, <a class="el" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a>, <a class="el" href="classSoftI2C.html" title="Bit-banged implementation of an I2C master.">SoftI2C</a>, <a class="el" href="classDS1307RTC.html" title="Communicates with a DS1307 realtime clock chip via I2C.">DS1307RTC</a> (or <a class="el" href="classDS3232RTC.html" title="Communicates with a DS3232 realtime clock chip via I2C.">DS3232RTC</a>), <a class="el" href="classMelody.html" title="Plays a melody on a digital output pin using tone().">Melody</a> and <a class="el" href="group__power__save.html">PowerSave</a>. The clock has the following features:</p>
<ul>
<li>Displays both the time and date. </li>
<li>12 hour and 24 hour time display modes. </li>
<li>Up to 4 configurable alarm times, plus a snooze alarm. </li>
<li>Three alarm sounds to choose from. </li>
<li>Configurable alarm timeout between 2 and 10 seconds. </li>
<li>Single button to activate the back light and/or stop the alarm. </li>
<li>Up, down, left, and right buttons to change clock settings.</li>
</ul>
<h2><a class="anchor" id="clock_main_circuit"></a>
Main circuit</h2>
<p>The main clock circuit consists of an Arduino Uno compatible board, a 16x2 <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> module, a realtime clock chip, and a piezo buzzer for the alarm:</p>
<div class="image">
<img src="alarm_circuit.png" alt="alarm_circuit.png"/>
</div>
<p>Some of the components can be purchased ready-made as the <a href="http://www.freetronics.com/pages/16x2-lcd-shield-quickstart-guide">Freetronics 16x2 LCD Shield</a> and the <a href="http://www.sparkfun.com/products/99">SparkFun Realtime Clock Module</a>. I used the ready-made realtime clock module, but made my own equivalent to the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> shield from parts to aid in spacing out the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> and pushbuttons on the exterior of the box. The value of the 33R resistor may need to be adjusted for different types of back light LED's. See <a class="el" href="alarm_clock.html#clock_ds3232">below</a> for information on using a DS3232-based clock module instead of a DS1307-based module.</p>
<p>The whole circuit is built on a prototyping shield, with ribbon cables connecting to the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a>. The Stop Alarm button and piezo buzzer are not shown in this picture and some of the components are soldered to the bottom of the shield:</p>
<div class="image">
<img src="clock_shield.jpg" alt="clock_shield.jpg"/>
</div>
<p>The clock module is based on the DS1307 chip and has an on-board coin battery to keep the time and date ticking over even if the main circuit loses power. The chip is I2C-based and has an auxillary SQW output that can be configured to provide a 1 Hz squarewave signal. This signal is used by the software running on the Arduino to detect when a new time or date is available for display on the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a>. The <a class="el" href="classDS1307RTC.html" title="Communicates with a DS1307 realtime clock chip via I2C.">DS1307RTC</a> class takes care of the details of talking to the chip via I2C.</p>
<h2><a class="anchor" id="clock_arduino_board"></a>
Arduino board</h2>
<p>To keep power consumption low, say for being powered by batteries, we don't need a full Arduino Uno or similar board. The USB interface is unnecessary, as is the on-board power supply if there is an external source of 5 volt power. We also don't want the power and D13 status LED's to be draining power. Therefore, a cut-down version of the Arduino is recommended. We used the <a href="http://www.freetronics.com/collections/arduino/products/kitten">KitTen</a> kit from <a href="http://www.freetronics.com/">Freetronics</a>, and didn't solder up anything that wasn't strictly necessary. A <a href="http://www.freetronics.com/ftdi-cable">5v FTDI USB-to-Serial cable</a> is necessary for programming. Similar minimalistic built-it-yourself Arduino designs should also work.</p>
<div class="image">
<img src="kitten_minimal.jpg" alt="kitten_minimal.jpg"/>
</div>
<h2><a class="anchor" id="clock_ds3232"></a>
Using DS3232 instead of DS1307</h2>
<p>For clock modules based on the DS3232 chip, such as the <a href="http://www.freetronics.com/products/real-time-clock-rtc-module">Freetronics Real Time Clock Module</a>, change the <code>Clock</code> typedef in <code>Clock.h</code> to the following:</p>
<div class="fragment"><pre class="fragment"><span class="keyword">typedef</span> <a class="code" href="classDS3232RTC.html" title="Communicates with a DS3232 realtime clock chip via I2C.">DS3232RTC</a> Clock;
</pre></div><p>The pads on the Freetronics module should be connected to the Arduino as follows:</p>
<ul>
<li>VCC and GND connected to 5V and GND on the Arduino. </li>
<li>SQI connected to A3. </li>
<li>SDA connected to A4. </li>
<li>SCL connected to A5. </li>
<li>BAT, 32K, and RST left unconnected. </li>
</ul>
</div></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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

107
annotated.html Normal file
View File

@ -0,0 +1,107 @@
<!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"/>
<title>ArduinoLibs: Class List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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 class="current"><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">Class List</div> </div>
</div>
<div class="contents">
<div class="textblock">Here are the classes, structs, unions and interfaces with brief descriptions:</div><table>
<tr><td class="indexkey"><a class="el" href="classBlinkLED.html">BlinkLED</a></td><td class="indexvalue">Blink a LED on a digital output pin </td></tr>
<tr><td class="indexkey"><a class="el" href="classBoolField.html">BoolField</a></td><td class="indexvalue"><a class="el" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> that manages the input of a boolean value </td></tr>
<tr><td class="indexkey"><a class="el" href="classChaseLEDs.html">ChaseLEDs</a></td><td class="indexvalue">Chase LED's on output pins in a defined sequence </td></tr>
<tr><td class="indexkey"><a class="el" href="classDS1307RTC.html">DS1307RTC</a></td><td class="indexvalue">Communicates with a DS1307 realtime clock chip via I2C </td></tr>
<tr><td class="indexkey"><a class="el" href="classDS3232RTC.html">DS3232RTC</a></td><td class="indexvalue">Communicates with a DS3232 realtime clock chip via I2C </td></tr>
<tr><td class="indexkey"><a class="el" href="classField.html">Field</a></td><td class="indexvalue">Manages a single data input/output field within a <a class="el" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> </td></tr>
<tr><td class="indexkey"><a class="el" href="classForm.html">Form</a></td><td class="indexvalue">Manager for a form containing data input/output fields </td></tr>
<tr><td class="indexkey"><a class="el" href="classI2CMaster.html">I2CMaster</a></td><td class="indexvalue">Abstract base class for I2C master implementations </td></tr>
<tr><td class="indexkey"><a class="el" href="classIntField.html">IntField</a></td><td class="indexvalue"><a class="el" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> that manages the input of an integer value </td></tr>
<tr><td class="indexkey"><a class="el" href="classLCD.html">LCD</a></td><td class="indexvalue">Enhanced library for Freetronics 16x2 <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> shields </td></tr>
<tr><td class="indexkey"><a class="el" href="classListField.html">ListField</a></td><td class="indexvalue"><a class="el" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> that manages selection from a static list of items </td></tr>
<tr><td class="indexkey"><a class="el" href="classMelody.html">Melody</a></td><td class="indexvalue">Plays a melody on a digital output pin using tone() </td></tr>
<tr><td class="indexkey"><a class="el" href="classRTC.html">RTC</a></td><td class="indexvalue">Base class for realtime clock handlers </td></tr>
<tr><td class="indexkey"><a class="el" href="structRTCAlarm.html">RTCAlarm</a></td><td class="indexvalue">Stores alarm information from a realtime clock chip </td></tr>
<tr><td class="indexkey"><a class="el" href="structRTCDate.html">RTCDate</a></td><td class="indexvalue">Stores date information from a realtime clock chip </td></tr>
<tr><td class="indexkey"><a class="el" href="structRTCTime.html">RTCTime</a></td><td class="indexvalue">Stores time information from a realtime clock chip </td></tr>
<tr><td class="indexkey"><a class="el" href="classSoftI2C.html">SoftI2C</a></td><td class="indexvalue">Bit-banged implementation of an I2C master </td></tr>
<tr><td class="indexkey"><a class="el" href="classTextField.html">TextField</a></td><td class="indexvalue"><a class="el" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> that displays a read-only text value </td></tr>
<tr><td class="indexkey"><a class="el" href="classTimeField.html">TimeField</a></td><td class="indexvalue"><a class="el" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> that manages the display and editing of a time value </td></tr>
</table>
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

BIN
bc_s.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 677 B

88
blink-blink_8dox.html Normal file
View File

@ -0,0 +1,88 @@
<!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"/>
<title>ArduinoLibs: blink-blink.dox File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">blink-blink.dox File Reference</div> </div>
</div>
<div class="contents">
<table class="memberdecls">
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock">
<p>Definition in file <a class="el" href="blink-blink_8dox_source.html">blink-blink.dox</a>.</p>
</div></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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

88
blink-cylon_8dox.html Normal file
View File

@ -0,0 +1,88 @@
<!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"/>
<title>ArduinoLibs: blink-cylon.dox File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">blink-cylon.dox File Reference</div> </div>
</div>
<div class="contents">
<table class="memberdecls">
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock">
<p>Definition in file <a class="el" href="blink-cylon_8dox_source.html">blink-cylon.dox</a>.</p>
</div></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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

88
blink-startrek_8dox.html Normal file
View File

@ -0,0 +1,88 @@
<!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"/>
<title>ArduinoLibs: blink-startrek.dox File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">blink-startrek.dox File Reference</div> </div>
</div>
<div class="contents">
<table class="memberdecls">
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock">
<p>Definition in file <a class="el" href="blink-startrek_8dox_source.html">blink-startrek.dox</a>.</p>
</div></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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

116
blink_blink.html Normal file
View File

@ -0,0 +1,116 @@
<!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"/>
<title>ArduinoLibs: Blinking LED Example</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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>
<div class="header">
<div class="headertitle">
<div class="title">Blinking LED Example </div> </div>
</div>
<div class="contents">
<div class="textblock"><p>The <a class="el" href="classBlinkLED.html" title="Blink a LED on a digital output pin.">BlinkLED</a> class provides support logic for blinking a LED connected to an output pin. The traditional way to blink a LED uses a delay loop:</p>
<div class="fragment"><pre class="fragment"><span class="keywordtype">void</span> loop() {
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
delay(1000);
}
</pre></div><p>The problem with this code is that the entire application is blocked during the <code>delay()</code>. No other activities can be serviced. <a class="el" href="classBlinkLED.html" title="Blink a LED on a digital output pin.">BlinkLED</a> provides a re-entrant timer-based implementation that is simple to use in any application and which won't block other activities.</p>
<p>We start this example by including the <a class="el" href="classBlinkLED.html" title="Blink a LED on a digital output pin.">BlinkLED</a> class and instantiating an object instance:</p>
<div class="fragment"><pre class="fragment"><span class="preprocessor">#include &lt;BlinkLED.h&gt;</span>
<a class="code" href="classBlinkLED.html" title="Blink a LED on a digital output pin.">BlinkLED</a> statusBlink(13, 70, 930);
</pre></div></p>
<p>In this example we have specified that the LED is on pin D13, the LED should be on for 70 milliseconds, and off for 930 milliseconds. This will cause the status LED to "strobe" once per second. The LED will be initially off for 930 milliseconds after device reset. To start with the LED on, use the following initialization code instead:</p>
<div class="fragment"><pre class="fragment"><a class="code" href="classBlinkLED.html" title="Blink a LED on a digital output pin.">BlinkLED</a> statusBlink(13, 70, 930, <span class="keyword">true</span>);
</pre></div><p>The remaining code we need is a call to <a class="el" href="classBlinkLED.html#aeeaf42b94c5392935f00f0f12a58c75e">BlinkLED::loop()</a> every time around the main application loop:</p>
<div class="fragment"><pre class="fragment"><span class="keywordtype">void</span> loop() {
statusBlink.loop();
}
</pre></div></p>
<p>As can be seen, <a class="el" href="classBlinkLED.html" title="Blink a LED on a digital output pin.">BlinkLED</a> simplifies the process of blinking a LED quite considerably. It is also possible to <a class="el" href="classBlinkLED.html#a2760a0223cd6a0598b961f681ffb5c0a">pause()</a> and <a class="el" href="classBlinkLED.html#a380241e4dfd20e8a558487227f2f4252">resume()</a> the blinking. This is useful in applications where a blinking LED indicates a certain state such as an error condition or a long-running operation that is in progress; with the LED off at other times. The on/off blink rate can be modified at runtime using <a class="el" href="classBlinkLED.html#a47f95624881063aa91c0066ed2c92258" title="Sets the onTime and offTime (in milliseconds).">BlinkLED::setBlinkRate()</a>, and the LED can be set to a specific value using <a class="el" href="classBlinkLED.html#af904a345e56d49948a042ac439d0b9d4" title="Sets the current state of the LED, where true is on, false is off.">BlinkLED::setState()</a>.</p>
<p>The full source code for the example follows:</p>
<div class="fragment"><pre class="fragment"><span class="comment">/*</span>
<span class="comment">Blink the status LED using the BlinkLED utility class.</span>
<span class="comment"></span>
<span class="comment">This example is placed into the public domain.</span>
<span class="comment">*/</span>
<span class="preprocessor">#include &lt;BlinkLED.h&gt;</span>
<a class="code" href="classBlinkLED.html" title="Blink a LED on a digital output pin.">BlinkLED</a> statusBlink(13, 70, 930);
<span class="keywordtype">void</span> setup() {}
<span class="keywordtype">void</span> loop() {
statusBlink.loop();
}
</pre></div> </div></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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

167
blink_cylon.html Normal file
View File

@ -0,0 +1,167 @@
<!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"/>
<title>ArduinoLibs: Cylon Eyes Example</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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>
<div class="header">
<div class="headertitle">
<div class="title">Cylon Eyes Example </div> </div>
</div>
<div class="contents">
<div class="textblock"><p>This example shows how to use the <a class="el" href="classChaseLEDs.html" title="Chase LED&#39;s on output pins in a defined sequence.">ChaseLEDs</a> class to simulate the Cylon eye effect from Battlestar Galactica. Digital outputs are used to drive six LED's in a back and forth motion, using the following schematic:</p>
<div class="image">
<img src="Cylon.png" alt="Cylon.png"/>
</div>
<p>We start by including the <a class="el" href="classChaseLEDs.html" title="Chase LED&#39;s on output pins in a defined sequence.">ChaseLEDs</a> class:</p>
<div class="fragment"><pre class="fragment"><span class="preprocessor">#include &lt;ChaseLEDs.h&gt;</span>
</pre></div></p>
<p>The next step is to define the pins that the chase will run over:</p>
<div class="fragment"><pre class="fragment">byte pins[] = {3, 5, 6, 9, 10, 11, 10, 9, 6, 5};
<a class="code" href="classChaseLEDs.html" title="Chase LED&#39;s on output pins in a defined sequence.">ChaseLEDs</a> cylonEyes(pins, <span class="keyword">sizeof</span>(pins), 100);
</pre></div></p>
<p>The chase runs from the first pin to the sixth pin and back again, with each LED lit for 100 milliseconds before moving onto the next one. To complete the example, we need to call <a class="el" href="classChaseLEDs.html#a8745fa6b9f33b6c6274a563dd4dea786">ChaseLEDs::loop()</a> each time around our main loop to cause the chase to run:</p>
<div class="fragment"><pre class="fragment"><span class="keywordtype">void</span> loop() {
cylonEyes.loop();
}
</pre></div></p>
<p>While this example uses only six pins, it can be easily extended to any number of pins by modifying the <code>pins</code> array and altering the schematic accordingly.</p>
<p>So far we are chasing only a single LED. We could change this to chase two adjacent LED's instead by defining a new <code>CylonChase</code> class that inherits from <a class="el" href="classChaseLEDs.html" title="Chase LED&#39;s on output pins in a defined sequence.">ChaseLEDs</a>:</p>
<div class="fragment"><pre class="fragment"><span class="keyword">class </span>CylonChase : <span class="keyword">public</span> <a class="code" href="classChaseLEDs.html" title="Chase LED&#39;s on output pins in a defined sequence.">ChaseLEDs</a>
{
<span class="keyword">public</span>:
CylonChase(<span class="keyword">const</span> byte *pins, <span class="keywordtype">int</span> num, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> advanceTime)
: <a class="code" href="classChaseLEDs.html" title="Chase LED&#39;s on output pins in a defined sequence.">ChaseLEDs</a>(pins, num, advanceTime) {}
<span class="keyword">protected</span>:
<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.">advance</a>(byte prevPin, byte nextPin) {
digitalWrite(<a class="code" href="classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525" title="Returns the pin that is n steps back in the sequence.">previousPin</a>(2), LOW);
digitalWrite(prevPin, HIGH);
digitalWrite(nextPin, HIGH);
}
};
</pre></div></p>
<p>The important part is the implementation of the <code>advance()</code> method, which overrides <a class="el" href="classChaseLEDs.html#aa0f4e0bd07dd65ee5574e894a612486b" title="Advances to the next LED in sequence, turning off prevPin, and turning on nextPin.">ChaseLEDs::advance()</a> to provide our own scheme for lighting the LED's each time the chase advances. We use <a class="el" href="classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525" title="Returns the pin that is n steps back in the sequence.">ChaseLEDs::previousPin()</a> to get the pin that is 2 steps back in the sequence, set it to LOW, and then set the previous pin (1 step back) and the next pin to HIGH. All that remains is to change our chase initialization to use the new class:</p>
<div class="fragment"><pre class="fragment">byte pins[] = {3, 5, 6, 9, 10, 11, 10, 9, 6, 5};
CylonChase cylonEyes(pins, <span class="keyword">sizeof</span>(pins), 100);
</pre></div></p>
<p>We can do even better than this. Instead of fully lighting both LED's, we could instead use the PWM outputs to dim the previous pin, creating a kind of "trailing flame" effect:</p>
<div class="fragment"><pre class="fragment"> <span class="keywordtype">void</span> advance(byte prevPin, byte nextPin) {
digitalWrite(previousPin(2), LOW);
analogWrite(prevPin, 32);
digitalWrite(nextPin, HIGH);
}
</pre></div></p>
<p>The current chase is fixed at 100 milliseconds per LED, which takes a full second to run the sequence. An alternative to hard-wiring the chase rate is to hook up a 10K potentiometer to the A0 analog input:</p>
<div class="image">
<img src="Cylon4.png" alt="Cylon4.png"/>
</div>
<p>We then modify the <code>advance()</code> method to read the new chase rate from the potentiometer each time the LED advances:</p>
<div class="fragment"><pre class="fragment"> <span class="keywordtype">void</span> advance(byte prevPin, byte nextPin) {
digitalWrite(previousPin(2), LOW);
analogWrite(prevPin, 32);
digitalWrite(nextPin, HIGH);
setAdvanceTime(map(analogRead(A0), 0, 1023, 25, 250));
}
</pre></div></p>
<p>The full source code for the final version of the example follows:</p>
<div class="fragment"><pre class="fragment"><span class="comment">/*</span>
<span class="comment">Sketch that manipulates Arduino outputs to create the &quot;Cylon Eyes&quot; effect from</span>
<span class="comment">Battlestar Galactica. It uses the ChaseLEDs utility class.</span>
<span class="comment"></span>
<span class="comment">This example is placed into the public domain.</span>
<span class="comment">*/</span>
<span class="preprocessor">#include &lt;ChaseLEDs.h&gt;</span>
<span class="keyword">class </span>CylonChase : <span class="keyword">public</span> <a class="code" href="classChaseLEDs.html" title="Chase LED&#39;s on output pins in a defined sequence.">ChaseLEDs</a>
{
<span class="keyword">public</span>:
CylonChase(<span class="keyword">const</span> byte *pins, <span class="keywordtype">int</span> num, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> advanceTime)
: <a class="code" href="classChaseLEDs.html" title="Chase LED&#39;s on output pins in a defined sequence.">ChaseLEDs</a>(pins, num, advanceTime) {}
<span class="keyword">protected</span>:
<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.">advance</a>(byte prevPin, byte nextPin) {
digitalWrite(<a class="code" href="classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525" title="Returns the pin that is n steps back in the sequence.">previousPin</a>(2), LOW);
analogWrite(prevPin, 32);
digitalWrite(nextPin, HIGH);
<a class="code" href="classChaseLEDs.html#af560270f72302c19fb7f95002089c9d7" title="Sets the number of milliseconds to advance between LED&#39;s to advanceTime.">setAdvanceTime</a>(map(analogRead(A0), 0, 1023, 25, 250));
}
};
byte pins[] = {3, 5, 6, 9, 10, 11, 10, 9, 6, 5};
CylonChase cylonEyes(pins, <span class="keyword">sizeof</span>(pins), 100);
<span class="keywordtype">void</span> setup() {}
<span class="keywordtype">void</span> loop() {
cylonEyes.loop();
}
</pre></div> </div></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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

233
blink_startrek.html Normal file
View File

@ -0,0 +1,233 @@
<!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"/>
<title>ArduinoLibs: Star Trek Example</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<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>
<div class="header">
<div class="headertitle">
<div class="title">Star Trek Example </div> </div>
</div>
<div class="contents">
<div class="textblock"><p>This example shows how to use the <a class="el" href="classBlinkLED.html" title="Blink a LED on a digital output pin.">BlinkLED</a> and <a class="el" href="classChaseLEDs.html" title="Chase LED&#39;s on output pins in a defined sequence.">ChaseLEDs</a> classes to simulate the running lights on the starship Enterprise from Star Trek. This can be used as the basis for lighting a model kit. It is recommended that you read the <a class="el" href="blink_blink.html">Blink</a> and <a class="el" href="blink_cylon.html">Cylon</a> tutorials first.</p>
<p>There are four categories of lights on the Enterprise:</p>
<ul>
<li>Static lights in windows, engines, and the deflector dish. We don't handle those in this example as we assume that they are connected directly to the power supply with no computer control. </li>
<li>Red and green navigation lights on the left and right of the saucer, and on the left and right warp nacelles, typically with a 1 second period. The red light is on the left as viewed from the back of the model. </li>
<li>White strobe light behind the bridge and on the warp nacelles that comes on briefly every second. </li>
<li>Nacelle lights that perform a circular LED chase in the front of the nacelles to create the warp engine twirl effect.</li>
</ul>
<p>Different models of the Enterprise have the lights in different places, and the period of flashing can vary from TV show to show, and sometimes from episode to episode. There isn't a definitive set of blink timings or number of LED's in the nacelle chase. The sketch has a number of configurable parameters that gives the user the freedom to choose which show and/or episode they wish to treat as "canonical" for their model.</p>
<p>We start by building a test circuit with a small number of LED's for each of the three categories (navigation, strobe, and nacelles):</p>
<div class="image">
<img src="StarTrek.png" alt="StarTrek.png"/>
</div>
<p>This won't be the final circuit for the model, but building it on a breadboard will help with the initial prototyping stages and choosing the appropriate blink timings:</p>
<div class="image">
<img src="StarTrekBreadboard.png" alt="StarTrekBreadboard.png"/>
</div>
<p>Alternatively, the test circuit can be built on a prototyping shield with the chase LED's in a circular arrangement to simulate how they will look when placed in the front of the model's warp nacelles:</p>
<div class="image">
<img src="StarTrekShield.png" alt="StarTrekShield.png"/>
</div>
<p>Now that we have a circuit, let's configure the red navigation LED on AOUT2 using the <a class="el" href="classBlinkLED.html" title="Blink a LED on a digital output pin.">BlinkLED</a> class, to blink with a period of 1000 milliseconds on, 1000 milliseconds off:</p>
<div class="fragment"><pre class="fragment"><span class="preprocessor">#include &lt;BlinkLED.h&gt;</span>
<span class="preprocessor">#define NAV_LIGHTS A2 // Output pin for controlling the navigation lights</span>
<span class="preprocessor">#define NAV_LIGHTS_ON 1000 // Time the navigation lights are on (milliseconds)</span>
<span class="preprocessor">#define NAV_LIGHTS_OFF 1000 // Time the navigation lights are off (milliseconds)</span>
<a class="code" href="classBlinkLED.html" title="Blink a LED on a digital output pin.">BlinkLED</a> navLights(NAV_LIGHTS, NAV_LIGHTS_ON, NAV_LIGHTS_OFF);
</pre></div></p>
<p>We repeat the process for the strobe LED on AOUT3, with a period of 70 milliseconds on, and 830 milliseconds off:</p>
<div class="fragment"><pre class="fragment"><span class="preprocessor">#define STROBE_LIGHT A3 // Output pin for controlling the strobe</span>
<span class="preprocessor">#define STROBE_LIGHT_ON 70 // Time the strobe light is on (milliseconds)</span>
<span class="preprocessor">#define STROBE_LIGHT_OFF 830 // Time the strobe light is off (milliseconds)</span>
<a class="code" href="classBlinkLED.html" title="Blink a LED on a digital output pin.">BlinkLED</a> strobeLight(STROBE_LIGHT, STROBE_LIGHT_ON, STROBE_LIGHT_OFF);
</pre></div></p>
<p>We also need to arrange for <a class="el" href="classBlinkLED.html#aeeaf42b94c5392935f00f0f12a58c75e">BlinkLED::loop()</a> to be called from the application's main <code>loop()</code> function:</p>
<div class="fragment"><pre class="fragment"><span class="keywordtype">void</span> loop() {
navLights.loop();
strobeLight.loop();
}
</pre></div><p>If you run the sketch at this point, you should see the navigation and strobe LED's blink with the selected rates.</p>
<p>Next is the twirl effect in the warp nacelles, using the <a class="el" href="classChaseLEDs.html" title="Chase LED&#39;s on output pins in a defined sequence.">ChaseLEDs</a> class. We are actually going to inherit from <a class="el" href="classChaseLEDs.html" title="Chase LED&#39;s on output pins in a defined sequence.">ChaseLEDs</a> to create a custom LED chaser that reads the chase rate from AIN0 and uses PWM outputs to create a trailing flame effect. See the <a class="el" href="blink_cylon.html">Cylon</a> example for more information on creating custom effects with <a class="el" href="classChaseLEDs.html" title="Chase LED&#39;s on output pins in a defined sequence.">ChaseLEDs</a>.</p>
<div class="fragment"><pre class="fragment"><span class="preprocessor">#define NACELLE_CHASE_LEN 6 // Length of nacelle chase, 1..6</span>
<span class="preprocessor"></span><span class="preprocessor">#define NACELLE_MIN_PERIOD 25 // Minimum time to advance the nacelle chase (milliseconds)</span>
<span class="preprocessor"></span><span class="preprocessor">#define NACELLE_MAX_PERIOD 250 // Maximum time to advance the nacelle chase (milliseconds)</span>
<span class="preprocessor"></span><span class="preprocessor">#define NACELLE_DIM_VALUE 32 // Value for dimming previous LED in chase, 0..255</span>
<span class="preprocessor"></span>
<span class="comment">// Output pins to use for the nacelle chase</span>
byte nacelleChasePins[6] = {3, 5, 6, 9, 10, 11};
<span class="keyword">class </span>NacelleChaseLEDs : <span class="keyword">public</span> <a class="code" href="classChaseLEDs.html" title="Chase LED&#39;s on output pins in a defined sequence.">ChaseLEDs</a>
{
<span class="keyword">public</span>:
NacelleChaseLEDs(<span class="keyword">const</span> byte *pins, <span class="keywordtype">int</span> num)
: <a class="code" href="classChaseLEDs.html" title="Chase LED&#39;s on output pins in a defined sequence.">ChaseLEDs</a>(pins, num, 0) {}
<span class="keyword">protected</span>:
<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.">advance</a>(byte prevPin, byte nextPin) {
digitalWrite(<a class="code" href="classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525" title="Returns the pin that is n steps back in the sequence.">previousPin</a>(2), LOW);
analogWrite(prevPin, NACELLE_DIM_VALUE);
digitalWrite(nextPin, HIGH);
<a class="code" href="classChaseLEDs.html#af560270f72302c19fb7f95002089c9d7" title="Sets the number of milliseconds to advance between LED&#39;s to advanceTime.">setAdvanceTime</a>(map(analogRead(NACELLE_RATE), 0, 1023, NACELLE_MIN_PERIOD, NACELLE_MAX_PERIOD));
}
};
NacelleChaseLEDs nacelleChase(nacelleChasePins, NACELLE_CHASE_LEN);
</pre></div></p>
<p>We also need to add a call to <a class="el" href="classChaseLEDs.html#a8745fa6b9f33b6c6274a563dd4dea786">ChaseLEDs::loop()</a> to the application's main loop:</p>
<div class="fragment"><pre class="fragment"><span class="keywordtype">void</span> loop() {
navLights.loop();
strobeLight.loop();
nacelleChase.loop();
}
</pre></div></p>
<p>Running the sketch now should cause the six LED's in the nacelle sequence to chase, in addition to the navigation and strobe LED's. The 10K potentiometer can be used to select the desired chase rate. This completes the test circuit, and will allow you to fiddle with the blink timings and chase rate until you are happy with the result.</p>
<p>We've made provision in this sketch for six outputs in the chase, but some models may only use three or five. The <code>NACELLE_CHASE_LEN</code> parameter controls the length of the chase.</p>
<p>With three outputs, the LED's can be arranged in opposite pairs, lighting two LED's at a time. The following circuit demonstrates how three outputs can be used to drive six LED's:</p>
<div class="image">
<img src="ThreeChase.png" alt="ThreeChase.png"/>
</div>
<p>You will need two of these circuits, for the left and right warp nacelles. The transistor drivers reduce the current load on the Arduino CPU and provide the option to drive the LED's from 12V instead of 5V.</p>
<p>It is recommended that you use transistor drivers for the navigation and strobe lights as well as there will be multiple LED's on each output in a real model. For example, there will be at least three each of the red and green navigation lights: the top of the saucer section, the bottom of the saucer section, and the top of the warp nacelle. Using a 12V supply will make it easier to string lots of LED's together in series.</p>
<p>Other nacelle effects are possible by modifying the <code>advance()</code> method in the sketch. For example, the "opposite pairs" effect with 3 outputs can also be done with 6 outputs and the following modification to the sketch:</p>
<div class="fragment"><pre class="fragment"> <span class="keywordtype">void</span> advance(byte prevPin, byte nextPin) {
digitalWrite(previousPin(5), LOW);
analogWrite(previousPin(4), NACELLE_DIM_VALUE);
digitalWrite(previousPin(3), HIGH);
digitalWrite(previousPin(2), LOW);
analogWrite(prevPin, NACELLE_DIM_VALUE);
digitalWrite(nextPin, HIGH);
setAdvanceTime(map(analogRead(NACELLE_RATE), 0, 1023, NACELLE_MIN_PERIOD, NACELLE_MAX_PERIOD));
}
</pre></div></p>
<p>The full source code for the example, including the "opposite pairs" effect, follows:</p>
<div class="fragment"><pre class="fragment"><span class="comment">/*</span>
<span class="comment">Sketch that manipulates Arduino outputs to create Star Trek Enterprise style</span>
<span class="comment">running lights and LED chasers.</span>
<span class="comment"></span>
<span class="comment">This example is placed into the public domain.</span>
<span class="comment">*/</span>
<span class="preprocessor">#include &lt;BlinkLED.h&gt;</span>
<span class="preprocessor">#include &lt;ChaseLEDs.h&gt;</span>
<span class="preprocessor">#define NACELLE_RATE A0 // Analog input for reading the nacelle chase rate</span>
<span class="preprocessor"></span><span class="preprocessor">#define NAV_LIGHTS A2 // Output pin for controlling the navigation lights</span>
<span class="preprocessor"></span><span class="preprocessor">#define STROBE_LIGHT A3 // Output pin for controlling the strobe</span>
<span class="preprocessor"></span>
<span class="comment">// Configurable parameters.</span>
<span class="preprocessor">#define NAV_LIGHTS_ON 1000 // Time the navigation lights are on (milliseconds)</span>
<span class="preprocessor"></span><span class="preprocessor">#define NAV_LIGHTS_OFF 1000 // Time the navigation lights are off (milliseconds)</span>
<span class="preprocessor"></span><span class="preprocessor">#define STROBE_LIGHT_ON 70 // Time the strobe light is on (milliseconds)</span>
<span class="preprocessor"></span><span class="preprocessor">#define STROBE_LIGHT_OFF 830 // Time the strobe light is off (milliseconds)</span>
<span class="preprocessor"></span><span class="preprocessor">#define NACELLE_CHASE_LEN 6 // Length of nacelle chase, 1..6</span>
<span class="preprocessor"></span><span class="preprocessor">#define NACELLE_MIN_PERIOD 25 // Minimum time to advance the nacelle chase (milliseconds)</span>
<span class="preprocessor"></span><span class="preprocessor">#define NACELLE_MAX_PERIOD 250 // Maximum time to advance the nacelle chase (milliseconds)</span>
<span class="preprocessor"></span><span class="preprocessor">#define NACELLE_DIM_VALUE 32 // Value for dimming previous LED in chase, 0..255</span>
<span class="preprocessor"></span>
<span class="comment">// Output pins to use for the nacelle chase</span>
byte nacelleChasePins[6] = {3, 5, 6, 9, 10, 11};
<span class="keyword">class </span>NacelleChaseLEDs : <span class="keyword">public</span> <a class="code" href="classChaseLEDs.html" title="Chase LED&#39;s on output pins in a defined sequence.">ChaseLEDs</a>
{
<span class="keyword">public</span>:
NacelleChaseLEDs(<span class="keyword">const</span> byte *pins, <span class="keywordtype">int</span> num)
: <a class="code" href="classChaseLEDs.html" title="Chase LED&#39;s on output pins in a defined sequence.">ChaseLEDs</a>(pins, num, 0) {}
<span class="keyword">protected</span>:
<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.">advance</a>(byte prevPin, byte nextPin) {
digitalWrite(<a class="code" href="classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525" title="Returns the pin that is n steps back in the sequence.">previousPin</a>(5), LOW);
analogWrite(<a class="code" href="classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525" title="Returns the pin that is n steps back in the sequence.">previousPin</a>(4), NACELLE_DIM_VALUE);
digitalWrite(<a class="code" href="classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525" title="Returns the pin that is n steps back in the sequence.">previousPin</a>(3), HIGH);
digitalWrite(<a class="code" href="classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525" title="Returns the pin that is n steps back in the sequence.">previousPin</a>(2), LOW);
analogWrite(prevPin, NACELLE_DIM_VALUE);
digitalWrite(nextPin, HIGH);
<a class="code" href="classChaseLEDs.html#af560270f72302c19fb7f95002089c9d7" title="Sets the number of milliseconds to advance between LED&#39;s to advanceTime.">setAdvanceTime</a>(map(analogRead(NACELLE_RATE), 0, 1023, NACELLE_MIN_PERIOD, NACELLE_MAX_PERIOD));
}
};
NacelleChaseLEDs nacelleChase(nacelleChasePins, NACELLE_CHASE_LEN);
<a class="code" href="classBlinkLED.html" title="Blink a LED on a digital output pin.">BlinkLED</a> navLights(NAV_LIGHTS, NAV_LIGHTS_ON, NAV_LIGHTS_OFF);
<a class="code" href="classBlinkLED.html" title="Blink a LED on a digital output pin.">BlinkLED</a> strobeLight(STROBE_LIGHT, STROBE_LIGHT_ON, STROBE_LIGHT_OFF);
<span class="keywordtype">void</span> setup() {
<span class="comment">// Turn off the status LED on the Arduino board (we don&#39;t need it).</span>
pinMode(13, OUTPUT);
digitalWrite(13, LOW);
}
<span class="keywordtype">void</span> loop() {
navLights.loop();
strobeLight.loop();
nacelleChase.loop();
}
</pre></div> </div></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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

View File

@ -0,0 +1,97 @@
<!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"/>
<title>ArduinoLibs: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">BlinkLED Member List</div> </div>
</div>
<div class="contents">
This is the complete list of members for <a class="el" href="classBlinkLED.html">BlinkLED</a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="classBlinkLED.html#afc33958651e7ce6dceb428ea654c2c2f">BlinkLED</a>(uint8_t pin, unsigned long onTime, unsigned long offTime, bool initialState=false)</td><td><a class="el" href="classBlinkLED.html">BlinkLED</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classBlinkLED.html#aa0ee318b886b84fb71d5831fa456ecc8">isPaused</a>() const </td><td><a class="el" href="classBlinkLED.html">BlinkLED</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classBlinkLED.html#aeeaf42b94c5392935f00f0f12a58c75e">loop</a>()</td><td><a class="el" href="classBlinkLED.html">BlinkLED</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classBlinkLED.html#a74c640edf1a9f6e8bea1e139462908bc">offTime</a>() const </td><td><a class="el" href="classBlinkLED.html">BlinkLED</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classBlinkLED.html#a8475f78f41d1a2d5d719bec8cbbb3ebb">onTime</a>() const </td><td><a class="el" href="classBlinkLED.html">BlinkLED</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classBlinkLED.html#a2760a0223cd6a0598b961f681ffb5c0a">pause</a>()</td><td><a class="el" href="classBlinkLED.html">BlinkLED</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classBlinkLED.html#a380241e4dfd20e8a558487227f2f4252">resume</a>()</td><td><a class="el" href="classBlinkLED.html">BlinkLED</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classBlinkLED.html#a47f95624881063aa91c0066ed2c92258">setBlinkRate</a>(unsigned long onTime, unsigned long offTime)</td><td><a class="el" href="classBlinkLED.html">BlinkLED</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classBlinkLED.html#af904a345e56d49948a042ac439d0b9d4">setState</a>(bool state)</td><td><a class="el" href="classBlinkLED.html">BlinkLED</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classBlinkLED.html#ab89b5b3435998ea6699d4bf94866e233">state</a>() const </td><td><a class="el" href="classBlinkLED.html">BlinkLED</a></td><td><code> [inline]</code></td></tr>
</table></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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

385
classBlinkLED.html Normal file
View File

@ -0,0 +1,385 @@
<!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"/>
<title>ArduinoLibs: BlinkLED Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> </div>
<div class="headertitle">
<div class="title">BlinkLED Class Reference</div> </div>
</div>
<div class="contents">
<!-- doxytag: class="BlinkLED" -->
<p>Blink a LED on a digital output pin.
<a href="classBlinkLED.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="BlinkLED_8h_source.html">BlinkLED.h</a>&gt;</code></p>
<p><a href="classBlinkLED-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBlinkLED.html#afc33958651e7ce6dceb428ea654c2c2f">BlinkLED</a> (uint8_t pin, unsigned long onTime, unsigned long offTime, bool initialState=false)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize a blinking LED on the specified <em>pin</em>. <a href="#afc33958651e7ce6dceb428ea654c2c2f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBlinkLED.html#aeeaf42b94c5392935f00f0f12a58c75e">loop</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBlinkLED.html#a8475f78f41d1a2d5d719bec8cbbb3ebb">onTime</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of milliseconds the LED will be on. <a href="#a8475f78f41d1a2d5d719bec8cbbb3ebb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBlinkLED.html#a74c640edf1a9f6e8bea1e139462908bc">offTime</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of milliseconds the LED will be off. <a href="#a74c640edf1a9f6e8bea1e139462908bc"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBlinkLED.html#a47f95624881063aa91c0066ed2c92258">setBlinkRate</a> (unsigned long onTime, unsigned long offTime)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the <em>onTime</em> and <em>offTime</em> (in milliseconds). <a href="#a47f95624881063aa91c0066ed2c92258"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBlinkLED.html#ab89b5b3435998ea6699d4bf94866e233">state</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current state of the LED; true is on, false is off. <a href="#ab89b5b3435998ea6699d4bf94866e233"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBlinkLED.html#af904a345e56d49948a042ac439d0b9d4">setState</a> (bool state)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the current <em>state</em> of the LED, where true is on, false is off. <a href="#af904a345e56d49948a042ac439d0b9d4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBlinkLED.html#a2760a0223cd6a0598b961f681ffb5c0a">pause</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Pauses the LED blink cycle in its current <a class="el" href="classBlinkLED.html#ab89b5b3435998ea6699d4bf94866e233" title="Returns the current state of the LED; true is on, false is off.">state()</a>. <a href="#a2760a0223cd6a0598b961f681ffb5c0a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBlinkLED.html#a380241e4dfd20e8a558487227f2f4252">resume</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Resumes the LED blink cycle after a <a class="el" href="classBlinkLED.html#a2760a0223cd6a0598b961f681ffb5c0a" title="Pauses the LED blink cycle in its current state().">pause()</a>. <a href="#a380241e4dfd20e8a558487227f2f4252"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBlinkLED.html#aa0ee318b886b84fb71d5831fa456ecc8">isPaused</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the LED blink cycle is paused; false otherwise. <a href="#aa0ee318b886b84fb71d5831fa456ecc8"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Blink a LED on a digital output pin. </p>
<p><a class="el" href="classBlinkLED.html" title="Blink a LED on a digital output pin.">BlinkLED</a> simplies the process of blinking a LED by encapsulating the control logic into a single class. The following example strobes the status LED on D13 with a period of 70 milliseconds on, 930 milliseconds off (the LED is initially off):</p>
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include &lt;BlinkLED.h&gt;</span>
<a class="code" href="classBlinkLED.html" title="Blink a LED on a digital output pin.">BlinkLED</a> statusBlink(13, 70, 930);
<span class="keywordtype">void</span> setup() {}
<span class="keywordtype">void</span> <a class="code" href="classBlinkLED.html#aeeaf42b94c5392935f00f0f12a58c75e">loop</a>() {
statusBlink.loop();
}
</pre></div><p>The current <a class="el" href="classBlinkLED.html#ab89b5b3435998ea6699d4bf94866e233" title="Returns the current state of the LED; true is on, false is off.">state()</a> of the LED can be changed immediately by calling <a class="el" href="classBlinkLED.html#af904a345e56d49948a042ac439d0b9d4" title="Sets the current state of the LED, where true is on, false is off.">setState()</a>. The blink rate can be modified with <a class="el" href="classBlinkLED.html#a47f95624881063aa91c0066ed2c92258" title="Sets the onTime and offTime (in milliseconds).">setBlinkRate()</a>. And the blink cycle can be suspended and restarted with <a class="el" href="classBlinkLED.html#a2760a0223cd6a0598b961f681ffb5c0a" title="Pauses the LED blink cycle in its current state().">pause()</a> and <a class="el" href="classBlinkLED.html#a380241e4dfd20e8a558487227f2f4252" title="Resumes the LED blink cycle after a pause().">resume()</a>. </p>
<p>Definition at line <a class="el" href="BlinkLED_8h_source.html#l00028">28</a> of file <a class="el" href="BlinkLED_8h_source.html">BlinkLED.h</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="afc33958651e7ce6dceb428ea654c2c2f"></a><!-- doxytag: member="BlinkLED::BlinkLED" ref="afc33958651e7ce6dceb428ea654c2c2f" args="(uint8_t pin, unsigned long onTime, unsigned long offTime, bool initialState=false)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">BlinkLED::BlinkLED </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>pin</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned long&#160;</td>
<td class="paramname"><em>onTime</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned long&#160;</td>
<td class="paramname"><em>offTime</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>initialState</em> = <code>false</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initialize a blinking LED on the specified <em>pin</em>. </p>
<p>The LED will blink with a rate defined by <em>onTime</em> and <em>offTime</em> (in milliseconds). Initially the LED's state is given by <em>initialState</em>, where true means initially on and false means initially off. </p>
<p>Definition at line <a class="el" href="BlinkLED_8cpp_source.html#l00064">64</a> of file <a class="el" href="BlinkLED_8cpp_source.html">BlinkLED.cpp</a>.</p>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="aa0ee318b886b84fb71d5831fa456ecc8"></a><!-- doxytag: member="BlinkLED::isPaused" ref="aa0ee318b886b84fb71d5831fa456ecc8" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool BlinkLED::isPaused </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns true if the LED blink cycle is paused; false otherwise. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classBlinkLED.html#a2760a0223cd6a0598b961f681ffb5c0a" title="Pauses the LED blink cycle in its current state().">pause()</a>, <a class="el" href="classBlinkLED.html#a380241e4dfd20e8a558487227f2f4252" title="Resumes the LED blink cycle after a pause().">resume()</a> </dd></dl>
<p>Definition at line <a class="el" href="BlinkLED_8h_source.html#l00044">44</a> of file <a class="el" href="BlinkLED_8h_source.html">BlinkLED.h</a>.</p>
</div>
</div>
<a class="anchor" id="aeeaf42b94c5392935f00f0f12a58c75e"></a><!-- doxytag: member="BlinkLED::loop" ref="aeeaf42b94c5392935f00f0f12a58c75e" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void BlinkLED::loop </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Perform a single iteration of the blink loop for this LED. </p>
<p>Definition at line <a class="el" href="BlinkLED_8cpp_source.html#l00079">79</a> of file <a class="el" href="BlinkLED_8cpp_source.html">BlinkLED.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a74c640edf1a9f6e8bea1e139462908bc"></a><!-- doxytag: member="BlinkLED::offTime" ref="a74c640edf1a9f6e8bea1e139462908bc" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned long BlinkLED::offTime </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the number of milliseconds the LED will be off. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classBlinkLED.html#a8475f78f41d1a2d5d719bec8cbbb3ebb" title="Returns the number of milliseconds the LED will be on.">onTime()</a>, <a class="el" href="classBlinkLED.html#a47f95624881063aa91c0066ed2c92258" title="Sets the onTime and offTime (in milliseconds).">setBlinkRate()</a> </dd></dl>
<p>Definition at line <a class="el" href="BlinkLED_8h_source.html#l00036">36</a> of file <a class="el" href="BlinkLED_8h_source.html">BlinkLED.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8475f78f41d1a2d5d719bec8cbbb3ebb"></a><!-- doxytag: member="BlinkLED::onTime" ref="a8475f78f41d1a2d5d719bec8cbbb3ebb" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned long BlinkLED::onTime </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the number of milliseconds the LED will be on. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classBlinkLED.html#a74c640edf1a9f6e8bea1e139462908bc" title="Returns the number of milliseconds the LED will be off.">offTime()</a>, <a class="el" href="classBlinkLED.html#a47f95624881063aa91c0066ed2c92258" title="Sets the onTime and offTime (in milliseconds).">setBlinkRate()</a> </dd></dl>
<p>Definition at line <a class="el" href="BlinkLED_8h_source.html#l00035">35</a> of file <a class="el" href="BlinkLED_8h_source.html">BlinkLED.h</a>.</p>
</div>
</div>
<a class="anchor" id="a2760a0223cd6a0598b961f681ffb5c0a"></a><!-- doxytag: member="BlinkLED::pause" ref="a2760a0223cd6a0598b961f681ffb5c0a" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void BlinkLED::pause </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Pauses the LED blink cycle in its current <a class="el" href="classBlinkLED.html#ab89b5b3435998ea6699d4bf94866e233" title="Returns the current state of the LED; true is on, false is off.">state()</a>. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classBlinkLED.html#a380241e4dfd20e8a558487227f2f4252" title="Resumes the LED blink cycle after a pause().">resume()</a>, <a class="el" href="classBlinkLED.html#aa0ee318b886b84fb71d5831fa456ecc8" title="Returns true if the LED blink cycle is paused; false otherwise.">isPaused()</a> </dd></dl>
<p>Definition at line <a class="el" href="BlinkLED_8h_source.html#l00042">42</a> of file <a class="el" href="BlinkLED_8h_source.html">BlinkLED.h</a>.</p>
</div>
</div>
<a class="anchor" id="a380241e4dfd20e8a558487227f2f4252"></a><!-- doxytag: member="BlinkLED::resume" ref="a380241e4dfd20e8a558487227f2f4252" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void BlinkLED::resume </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Resumes the LED blink cycle after a <a class="el" href="classBlinkLED.html#a2760a0223cd6a0598b961f681ffb5c0a" title="Pauses the LED blink cycle in its current state().">pause()</a>. </p>
<p>The LED will complete its current <a class="el" href="classBlinkLED.html#a8475f78f41d1a2d5d719bec8cbbb3ebb" title="Returns the number of milliseconds the LED will be on.">onTime()</a> or <a class="el" href="classBlinkLED.html#a74c640edf1a9f6e8bea1e139462908bc" title="Returns the number of milliseconds the LED will be off.">offTime()</a> and then will switch to the opposite <a class="el" href="classBlinkLED.html#ab89b5b3435998ea6699d4bf94866e233" title="Returns the current state of the LED; true is on, false is off.">state()</a>. If <a class="el" href="classBlinkLED.html#a8475f78f41d1a2d5d719bec8cbbb3ebb" title="Returns the number of milliseconds the LED will be on.">onTime()</a> or <a class="el" href="classBlinkLED.html#a74c640edf1a9f6e8bea1e139462908bc" title="Returns the number of milliseconds the LED will be off.">offTime()</a> has already expired, then the LED will immediately switch state.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classBlinkLED.html#a2760a0223cd6a0598b961f681ffb5c0a" title="Pauses the LED blink cycle in its current state().">pause()</a>, <a class="el" href="classBlinkLED.html#aa0ee318b886b84fb71d5831fa456ecc8" title="Returns true if the LED blink cycle is paused; false otherwise.">isPaused()</a> </dd></dl>
<p>Definition at line <a class="el" href="BlinkLED_8cpp_source.html#l00170">170</a> of file <a class="el" href="BlinkLED_8cpp_source.html">BlinkLED.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a47f95624881063aa91c0066ed2c92258"></a><!-- doxytag: member="BlinkLED::setBlinkRate" ref="a47f95624881063aa91c0066ed2c92258" args="(unsigned long onTime, unsigned long offTime)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void BlinkLED::setBlinkRate </td>
<td>(</td>
<td class="paramtype">unsigned long&#160;</td>
<td class="paramname"><em>onTime</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned long&#160;</td>
<td class="paramname"><em>offTime</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the <em>onTime</em> and <em>offTime</em> (in milliseconds). </p>
<p>The change takes effect immediately. If the current <a class="el" href="classBlinkLED.html#a8475f78f41d1a2d5d719bec8cbbb3ebb" title="Returns the number of milliseconds the LED will be on.">onTime()</a> or <a class="el" href="classBlinkLED.html#a74c640edf1a9f6e8bea1e139462908bc" title="Returns the number of milliseconds the LED will be off.">offTime()</a> has now expired, then the LED will immediately switch to the opposite <a class="el" href="classBlinkLED.html#ab89b5b3435998ea6699d4bf94866e233" title="Returns the current state of the LED; true is on, false is off.">state()</a>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classBlinkLED.html#a8475f78f41d1a2d5d719bec8cbbb3ebb" title="Returns the number of milliseconds the LED will be on.">onTime()</a>, <a class="el" href="classBlinkLED.html#a74c640edf1a9f6e8bea1e139462908bc" title="Returns the number of milliseconds the LED will be off.">offTime()</a> </dd></dl>
<p>Definition at line <a class="el" href="BlinkLED_8cpp_source.html#l00122">122</a> of file <a class="el" href="BlinkLED_8cpp_source.html">BlinkLED.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="af904a345e56d49948a042ac439d0b9d4"></a><!-- doxytag: member="BlinkLED::setState" ref="af904a345e56d49948a042ac439d0b9d4" args="(bool state)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void BlinkLED::setState </td>
<td>(</td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>state</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the current <em>state</em> of the LED, where true is on, false is off. </p>
<p>If the LED is already set to <em>state</em>, then it will complete its current cycle of <a class="el" href="classBlinkLED.html#a8475f78f41d1a2d5d719bec8cbbb3ebb" title="Returns the number of milliseconds the LED will be on.">onTime()</a> or <a class="el" href="classBlinkLED.html#a74c640edf1a9f6e8bea1e139462908bc" title="Returns the number of milliseconds the LED will be off.">offTime()</a>. Otherwise the LED is immediately set to <em>state</em> and a new cycle begins.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classBlinkLED.html#ab89b5b3435998ea6699d4bf94866e233" title="Returns the current state of the LED; true is on, false is off.">state()</a> </dd></dl>
<p>Definition at line <a class="el" href="BlinkLED_8cpp_source.html#l00145">145</a> of file <a class="el" href="BlinkLED_8cpp_source.html">BlinkLED.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ab89b5b3435998ea6699d4bf94866e233"></a><!-- doxytag: member="BlinkLED::state" ref="ab89b5b3435998ea6699d4bf94866e233" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool BlinkLED::state </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the current state of the LED; true is on, false is off. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classBlinkLED.html#af904a345e56d49948a042ac439d0b9d4" title="Sets the current state of the LED, where true is on, false is off.">setState()</a> </dd></dl>
<p>Definition at line <a class="el" href="BlinkLED_8h_source.html#l00039">39</a> of file <a class="el" href="BlinkLED_8h_source.html">BlinkLED.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="BlinkLED_8h_source.html">BlinkLED.h</a></li>
<li><a class="el" href="BlinkLED_8cpp_source.html">BlinkLED.cpp</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

107
classBoolField-members.html Normal file
View File

@ -0,0 +1,107 @@
<!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"/>
<title>ArduinoLibs: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">BoolField Member List</div> </div>
</div>
<div class="contents">
This is the complete list of members for <a class="el" href="classBoolField.html">BoolField</a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="classBoolField.html#a5d4382cdcdc989de0179d8f3f3a59998">BoolField</a>(const String &amp;label)</td><td><a class="el" href="classBoolField.html">BoolField</a></td><td><code> [explicit]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classBoolField.html#a49aad212ed18f84baa105c24e86281d9">BoolField</a>(Form &amp;form, const String &amp;label, const String &amp;trueLabel, const String &amp;falseLabel, bool value)</td><td><a class="el" href="classBoolField.html">BoolField</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classBoolField.html#af793bafc1193d79b495c2ede711bca57">dispatch</a>(int event)</td><td><a class="el" href="classBoolField.html">BoolField</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classBoolField.html#ab3f1e610b52caed7e41016f6ae3d7d09">enterField</a>(bool reverse)</td><td><a class="el" href="classBoolField.html">BoolField</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#ad6805c75ee1e62f8cd8bd550c4530c07">exitField</a>()</td><td><a class="el" href="classField.html">Field</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classBoolField.html#a59ad7a8a33290bda0d9fbb3df4f09b01">falseLabel</a>() const </td><td><a class="el" href="classBoolField.html">BoolField</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#ac4ea0d104376233c3f0bfc080ec8564e">Field</a>(const String &amp;label)</td><td><a class="el" href="classField.html">Field</a></td><td><code> [explicit]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#a7e2bdb203ddfd9219696f263c1731fe7">Field</a>(Form &amp;form, const String &amp;label)</td><td><a class="el" href="classField.html">Field</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#a27427319be1cc92db3128637d8884ee5">form</a>() const </td><td><a class="el" href="classField.html">Field</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#a25d86a67b321e8c642edf75a10a35f72">isCurrent</a>() const </td><td><a class="el" href="classField.html">Field</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#aaa861ef917130c989a955bc75c683afe">label</a>() const </td><td><a class="el" href="classField.html">Field</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1">lcd</a>() const </td><td><a class="el" href="classField.html">Field</a></td><td><code> [inline, protected]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classBoolField.html#ae6a29d27139fd78f2ca96152059fb30a">setFalseLabel</a>(const String &amp;falseLabel)</td><td><a class="el" href="classBoolField.html">BoolField</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#ad4ea63599d780c35b296cf2840b69f7b">setLabel</a>(const String &amp;label)</td><td><a class="el" href="classField.html">Field</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classBoolField.html#a803fc8c39765da4a44af01d925cd4194">setTrueLabel</a>(const String &amp;trueLabel)</td><td><a class="el" href="classBoolField.html">BoolField</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classBoolField.html#a080c575fd4a98e6afc4b9197fbab5577">setValue</a>(bool value)</td><td><a class="el" href="classBoolField.html">BoolField</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classBoolField.html#a9972030beec6e007b556c6eb652e163d">trueLabel</a>() const </td><td><a class="el" href="classBoolField.html">BoolField</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#afc612378167be0e7f8a6f8395b3537bd">updateCursor</a>()</td><td><a class="el" href="classField.html">Field</a></td><td><code> [protected, virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classBoolField.html#a9147826437fbaf9b29eda9dee9e37b39">value</a>() const </td><td><a class="el" href="classBoolField.html">BoolField</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#a45d6e6d09b8f8e46de62b40119d62c60">~Field</a>()</td><td><a class="el" href="classField.html">Field</a></td><td></td></tr>
</table></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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

417
classBoolField.html Normal file
View File

@ -0,0 +1,417 @@
<!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"/>
<title>ArduinoLibs: BoolField Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> </div>
<div class="headertitle">
<div class="title">BoolField Class Reference</div> </div>
</div>
<div class="contents">
<!-- doxytag: class="BoolField" --><!-- doxytag: inherits="Field" -->
<p><a class="el" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> that manages the input of a boolean value.
<a href="classBoolField.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="BoolField_8h_source.html">BoolField.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for BoolField:</div>
<div class="dyncontent">
<div class="center">
<img src="classBoolField.png" usemap="#BoolField_map" alt=""/>
<map id="BoolField_map" name="BoolField_map">
<area href="classField.html" title="Manages a single data input/output field within a Form." alt="Field" shape="rect" coords="0,0,65,24"/>
</map>
</div></div>
<p><a href="classBoolField-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBoolField.html#a5d4382cdcdc989de0179d8f3f3a59998">BoolField</a> (const String &amp;label)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new boolean field with a specific <em>label</em>. <a href="#a5d4382cdcdc989de0179d8f3f3a59998"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBoolField.html#a49aad212ed18f84baa105c24e86281d9">BoolField</a> (<a class="el" href="classForm.html">Form</a> &amp;form, const String &amp;label, const String &amp;trueLabel, const String &amp;falseLabel, bool value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new boolean field with a specific <em>label</em> and attaches it to a <em>form</em>. <a href="#a49aad212ed18f84baa105c24e86281d9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBoolField.html#af793bafc1193d79b495c2ede711bca57">dispatch</a> (int event)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Dispatches <em>event</em> via this field. <a href="#af793bafc1193d79b495c2ede711bca57"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBoolField.html#ab3f1e610b52caed7e41016f6ae3d7d09">enterField</a> (bool reverse)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Enters the field due to form navigation. <a href="#ab3f1e610b52caed7e41016f6ae3d7d09"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBoolField.html#a9147826437fbaf9b29eda9dee9e37b39">value</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current value of this field, true or false. <a href="#a9147826437fbaf9b29eda9dee9e37b39"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBoolField.html#a080c575fd4a98e6afc4b9197fbab5577">setValue</a> (bool value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the current value of this field to <em>value</em>. <a href="#a080c575fd4a98e6afc4b9197fbab5577"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const String &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBoolField.html#a9972030beec6e007b556c6eb652e163d">trueLabel</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the string that is displayed when <a class="el" href="classBoolField.html#a9147826437fbaf9b29eda9dee9e37b39" title="Returns the current value of this field, true or false.">value()</a> is true. <a href="#a9972030beec6e007b556c6eb652e163d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBoolField.html#a803fc8c39765da4a44af01d925cd4194">setTrueLabel</a> (const String &amp;trueLabel)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the string that is displayed when <a class="el" href="classBoolField.html#a9147826437fbaf9b29eda9dee9e37b39" title="Returns the current value of this field, true or false.">value()</a> is true to <em>trueLabel</em>. <a href="#a803fc8c39765da4a44af01d925cd4194"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const String &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBoolField.html#a59ad7a8a33290bda0d9fbb3df4f09b01">falseLabel</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the string that is displayed when <a class="el" href="classBoolField.html#a9147826437fbaf9b29eda9dee9e37b39" title="Returns the current value of this field, true or false.">value()</a> is false. <a href="#a59ad7a8a33290bda0d9fbb3df4f09b01"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBoolField.html#ae6a29d27139fd78f2ca96152059fb30a">setFalseLabel</a> (const String &amp;falseLabel)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the string that is displayed when <a class="el" href="classBoolField.html#a9147826437fbaf9b29eda9dee9e37b39" title="Returns the current value of this field, true or false.">value()</a> is false to <em>falseLabel</em>. <a href="#ae6a29d27139fd78f2ca96152059fb30a"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p><a class="el" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> that manages the input of a boolean value. </p>
<p><a class="el" href="classBoolField.html" title="Field that manages the input of a boolean value.">BoolField</a> is intended for field values that are modifiable by the user. Pressing one of Up or Down will toggle the field's current value.</p>
<p>The following example creates a boolean field that shows the state of the status LED on D13. When the LED is on (the default), the string "On" will be displayed on the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> screen. When the LED is off, the string "Off" will be displayed instead.</p>
<div class="fragment"><pre class="fragment"> <a class="code" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> mainForm(lcd);
<a class="code" href="classBoolField.html" title="Field that manages the input of a boolean value.">BoolField</a> ledField(mainForm, <span class="stringliteral">&quot;Status LED&quot;</span>, <span class="stringliteral">&quot;On&quot;</span>, <span class="stringliteral">&quot;Off&quot;</span>, <span class="keyword">true</span>);
</pre></div><div class="image">
<img src="FormBool.png" alt="FormBool.png"/>
</div>
<p>To actually toggle the LED, the application's main loop() function should contain the following code:</p>
<div class="fragment"><pre class="fragment"> <span class="keywordtype">int</span> <span class="keyword">event</span> = lcd.<a class="code" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292" title="Gets the next button press, release, or idle event.">getButton</a>();
<span class="keywordflow">if</span> (mainForm.dispatch(event) == FORM_CHANGED) {
<span class="keywordflow">if</span> (mainForm.isCurrent(ledField)) {
<span class="keywordflow">if</span> (ledField.value())
digitalWrite(STATUS_LED, HIGH);
<span class="keywordflow">else</span>
digitalWrite(STATUS_LED, LOW);
}
}
</pre></div><p>Use <a class="el" href="classTextField.html" title="Field that displays a read-only text value.">TextField</a> for read-only fields that report boolean values but which are not modifiable by the user.</p>
<p><a class="el" href="classListField.html" title="Field that manages selection from a static list of items.">ListField</a> can be used to select between more than two items.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a>, <a class="el" href="classListField.html" title="Field that manages selection from a static list of items.">ListField</a>, <a class="el" href="classTextField.html" title="Field that displays a read-only text value.">TextField</a> </dd></dl>
<p>Definition at line <a class="el" href="BoolField_8h_source.html#l00028">28</a> of file <a class="el" href="BoolField_8h_source.html">BoolField.h</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a5d4382cdcdc989de0179d8f3f3a59998"></a><!-- doxytag: member="BoolField::BoolField" ref="a5d4382cdcdc989de0179d8f3f3a59998" args="(const String &amp;label)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">BoolField::BoolField </td>
<td>(</td>
<td class="paramtype">const String &amp;&#160;</td>
<td class="paramname"><em>label</em></td><td>)</td>
<td><code> [explicit]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs a new boolean field with a specific <em>label</em>. </p>
<p>The field is initially not associated with a <a class="el" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a>. The field can be added to a form later using <a class="el" href="classForm.html#a5cb056ace428e75e321610555bfecac7" title="Adds field to this form.">Form::addField()</a>.</p>
<p>The initial <a class="el" href="classBoolField.html#a9147826437fbaf9b29eda9dee9e37b39" title="Returns the current value of this field, true or false.">value()</a> will be false.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classForm.html#a5cb056ace428e75e321610555bfecac7" title="Adds field to this form.">Form::addField()</a> </dd></dl>
<p>Definition at line <a class="el" href="BoolField_8cpp_source.html#l00077">77</a> of file <a class="el" href="BoolField_8cpp_source.html">BoolField.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a49aad212ed18f84baa105c24e86281d9"></a><!-- doxytag: member="BoolField::BoolField" ref="a49aad212ed18f84baa105c24e86281d9" args="(Form &amp;form, const String &amp;label, const String &amp;trueLabel, const String &amp;falseLabel, bool value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">BoolField::BoolField </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classForm.html">Form</a> &amp;&#160;</td>
<td class="paramname"><em>form</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const String &amp;&#160;</td>
<td class="paramname"><em>label</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const String &amp;&#160;</td>
<td class="paramname"><em>trueLabel</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const String &amp;&#160;</td>
<td class="paramname"><em>falseLabel</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>value</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs a new boolean field with a specific <em>label</em> and attaches it to a <em>form</em>. </p>
<p>The initial <a class="el" href="classBoolField.html#a9147826437fbaf9b29eda9dee9e37b39" title="Returns the current value of this field, true or false.">value()</a> of the field is set to the parameter <em>value</em>. When <a class="el" href="classBoolField.html#a9147826437fbaf9b29eda9dee9e37b39" title="Returns the current value of this field, true or false.">value()</a> is true, <em>trueLabel</em> will be displayed on the screen. When <a class="el" href="classBoolField.html#a9147826437fbaf9b29eda9dee9e37b39" title="Returns the current value of this field, true or false.">value()</a> is false, <em>falseLabel</em> will be displayed on the screen.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classBoolField.html#a9147826437fbaf9b29eda9dee9e37b39" title="Returns the current value of this field, true or false.">value()</a> </dd></dl>
<p>Definition at line <a class="el" href="BoolField_8cpp_source.html#l00094">94</a> of file <a class="el" href="BoolField_8cpp_source.html">BoolField.cpp</a>.</p>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="af793bafc1193d79b495c2ede711bca57"></a><!-- doxytag: member="BoolField::dispatch" ref="af793bafc1193d79b495c2ede711bca57" args="(int event)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int BoolField::dispatch </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>event</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Dispatches <em>event</em> via this field. </p>
<p>The <em>event</em> is usually obtained from <a class="el" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292" title="Gets the next button press, release, or idle event.">LCD::getButton()</a>.</p>
<p>Returns zero if the <em>event</em> has been handled and no further action is required.</p>
<p>Returns FORM_CHANGED if the <em>event</em> has changed the value of this field in a manner that may require the application to take further action based on the new field value.</p>
<p>Returns -1 if the <em>event</em> is not handled by this field, and should be handled by the <a class="el" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> itself (particularly for Left and Right buttons). The default implementation returns -1 for all events.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classForm.html#a89bd3850e87caa2ca7b2e946f923d0ee" title="Dispatches event to the currently active field using Field::dispatch().">Form::dispatch()</a>, <a class="el" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292" title="Gets the next button press, release, or idle event.">LCD::getButton()</a> </dd></dl>
<p>Reimplemented from <a class="el" href="classField.html#a061bd1ed4d8b079df86465df8facd3b3">Field</a>.</p>
<p>Definition at line <a class="el" href="BoolField_8cpp_source.html#l00103">103</a> of file <a class="el" href="BoolField_8cpp_source.html">BoolField.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ab3f1e610b52caed7e41016f6ae3d7d09"></a><!-- doxytag: member="BoolField::enterField" ref="ab3f1e610b52caed7e41016f6ae3d7d09" args="(bool reverse)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void BoolField::enterField </td>
<td>(</td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>reverse</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Enters the field due to form navigation. </p>
<p>This function is typically called when the user presses Left and Right buttons to navigate to the field. If <em>reverse</em> is true, then navigation was due to the Left button being pressed.</p>
<p>This function can assume that the display has been cleared and the cursor is positioned at (0, 0).</p>
<p>The default implementation prints the <a class="el" href="classField.html#aaa861ef917130c989a955bc75c683afe" title="Returns the label to display in the first line of this field.">label()</a>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classField.html#ad6805c75ee1e62f8cd8bd550c4530c07" title="Exits the field due to form navigation.">exitField()</a> </dd></dl>
<p>Reimplemented from <a class="el" href="classField.html#aa032bbeacb405c56546cb56fbbee94f5">Field</a>.</p>
<p>Definition at line <a class="el" href="BoolField_8cpp_source.html#l00113">113</a> of file <a class="el" href="BoolField_8cpp_source.html">BoolField.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a59ad7a8a33290bda0d9fbb3df4f09b01"></a><!-- doxytag: member="BoolField::falseLabel" ref="a59ad7a8a33290bda0d9fbb3df4f09b01" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const String &amp; BoolField::falseLabel </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the string that is displayed when <a class="el" href="classBoolField.html#a9147826437fbaf9b29eda9dee9e37b39" title="Returns the current value of this field, true or false.">value()</a> is false. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classBoolField.html#ae6a29d27139fd78f2ca96152059fb30a" title="Sets the string that is displayed when value() is false to falseLabel.">setFalseLabel()</a>, <a class="el" href="classBoolField.html#a9972030beec6e007b556c6eb652e163d" title="Returns the string that is displayed when value() is true.">trueLabel()</a> </dd></dl>
<p>Definition at line <a class="el" href="BoolField_8h_source.html#l00043">43</a> of file <a class="el" href="BoolField_8h_source.html">BoolField.h</a>.</p>
</div>
</div>
<a class="anchor" id="ae6a29d27139fd78f2ca96152059fb30a"></a><!-- doxytag: member="BoolField::setFalseLabel" ref="ae6a29d27139fd78f2ca96152059fb30a" args="(const String &amp;falseLabel)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void BoolField::setFalseLabel </td>
<td>(</td>
<td class="paramtype">const String &amp;&#160;</td>
<td class="paramname"><em>falseLabel</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the string that is displayed when <a class="el" href="classBoolField.html#a9147826437fbaf9b29eda9dee9e37b39" title="Returns the current value of this field, true or false.">value()</a> is false to <em>falseLabel</em>. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classBoolField.html#a59ad7a8a33290bda0d9fbb3df4f09b01" title="Returns the string that is displayed when value() is false.">falseLabel()</a>, <a class="el" href="classBoolField.html#a803fc8c39765da4a44af01d925cd4194" title="Sets the string that is displayed when value() is true to trueLabel.">setTrueLabel()</a> </dd></dl>
<p>Definition at line <a class="el" href="BoolField_8cpp_source.html#l00173">173</a> of file <a class="el" href="BoolField_8cpp_source.html">BoolField.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a803fc8c39765da4a44af01d925cd4194"></a><!-- doxytag: member="BoolField::setTrueLabel" ref="a803fc8c39765da4a44af01d925cd4194" args="(const String &amp;trueLabel)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void BoolField::setTrueLabel </td>
<td>(</td>
<td class="paramtype">const String &amp;&#160;</td>
<td class="paramname"><em>trueLabel</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the string that is displayed when <a class="el" href="classBoolField.html#a9147826437fbaf9b29eda9dee9e37b39" title="Returns the current value of this field, true or false.">value()</a> is true to <em>trueLabel</em>. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classBoolField.html#a9972030beec6e007b556c6eb652e163d" title="Returns the string that is displayed when value() is true.">trueLabel()</a>, <a class="el" href="classBoolField.html#ae6a29d27139fd78f2ca96152059fb30a" title="Sets the string that is displayed when value() is false to falseLabel.">setFalseLabel()</a> </dd></dl>
<p>Definition at line <a class="el" href="BoolField_8cpp_source.html#l00153">153</a> of file <a class="el" href="BoolField_8cpp_source.html">BoolField.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a080c575fd4a98e6afc4b9197fbab5577"></a><!-- doxytag: member="BoolField::setValue" ref="a080c575fd4a98e6afc4b9197fbab5577" args="(bool value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void BoolField::setValue </td>
<td>(</td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the current value of this field to <em>value</em>. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classBoolField.html#a9147826437fbaf9b29eda9dee9e37b39" title="Returns the current value of this field, true or false.">value()</a> </dd></dl>
<p>Definition at line <a class="el" href="BoolField_8cpp_source.html#l00131">131</a> of file <a class="el" href="BoolField_8cpp_source.html">BoolField.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a9972030beec6e007b556c6eb652e163d"></a><!-- doxytag: member="BoolField::trueLabel" ref="a9972030beec6e007b556c6eb652e163d" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const String &amp; BoolField::trueLabel </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the string that is displayed when <a class="el" href="classBoolField.html#a9147826437fbaf9b29eda9dee9e37b39" title="Returns the current value of this field, true or false.">value()</a> is true. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classBoolField.html#a803fc8c39765da4a44af01d925cd4194" title="Sets the string that is displayed when value() is true to trueLabel.">setTrueLabel()</a>, <a class="el" href="classBoolField.html#a59ad7a8a33290bda0d9fbb3df4f09b01" title="Returns the string that is displayed when value() is false.">falseLabel()</a> </dd></dl>
<p>Definition at line <a class="el" href="BoolField_8h_source.html#l00040">40</a> of file <a class="el" href="BoolField_8h_source.html">BoolField.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9147826437fbaf9b29eda9dee9e37b39"></a><!-- doxytag: member="BoolField::value" ref="a9147826437fbaf9b29eda9dee9e37b39" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool BoolField::value </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the current value of this field, true or false. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classBoolField.html#a080c575fd4a98e6afc4b9197fbab5577" title="Sets the current value of this field to value.">setValue()</a> </dd></dl>
<p>Definition at line <a class="el" href="BoolField_8h_source.html#l00037">37</a> of file <a class="el" href="BoolField_8h_source.html">BoolField.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="BoolField_8h_source.html">BoolField.h</a></li>
<li><a class="el" href="BoolField_8cpp_source.html">BoolField.cpp</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

BIN
classBoolField.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

View File

@ -0,0 +1,93 @@
<!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"/>
<title>ArduinoLibs: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">ChaseLEDs Member List</div> </div>
</div>
<div class="contents">
This is the complete list of members for <a class="el" href="classChaseLEDs.html">ChaseLEDs</a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="classChaseLEDs.html#aa0f4e0bd07dd65ee5574e894a612486b">advance</a>(uint8_t prevPin, uint8_t nextPin)</td><td><a class="el" href="classChaseLEDs.html">ChaseLEDs</a></td><td><code> [protected, virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classChaseLEDs.html#aed060c51bb63dd8065be89f895989700">advanceTime</a>() const </td><td><a class="el" href="classChaseLEDs.html">ChaseLEDs</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classChaseLEDs.html#ab6bb3da371d3730a6552e93a9b2eab78">ChaseLEDs</a>(const uint8_t *pins, int num, unsigned long advanceTime)</td><td><a class="el" href="classChaseLEDs.html">ChaseLEDs</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classChaseLEDs.html#a8745fa6b9f33b6c6274a563dd4dea786">loop</a>()</td><td><a class="el" href="classChaseLEDs.html">ChaseLEDs</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525">previousPin</a>(int n) const </td><td><a class="el" href="classChaseLEDs.html">ChaseLEDs</a></td><td><code> [inline, protected]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classChaseLEDs.html#af560270f72302c19fb7f95002089c9d7">setAdvanceTime</a>(unsigned long advanceTime)</td><td><a class="el" href="classChaseLEDs.html">ChaseLEDs</a></td><td><code> [inline]</code></td></tr>
</table></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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

311
classChaseLEDs.html Normal file
View File

@ -0,0 +1,311 @@
<!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"/>
<title>ArduinoLibs: ChaseLEDs Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> </div>
<div class="headertitle">
<div class="title">ChaseLEDs Class Reference</div> </div>
</div>
<div class="contents">
<!-- doxytag: class="ChaseLEDs" -->
<p>Chase LED's on output pins in a defined sequence.
<a href="classChaseLEDs.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="ChaseLEDs_8h_source.html">ChaseLEDs.h</a>&gt;</code></p>
<p><a href="classChaseLEDs-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChaseLEDs.html#ab6bb3da371d3730a6552e93a9b2eab78">ChaseLEDs</a> (const uint8_t *pins, int num, unsigned long advanceTime)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the LED chaser. <a href="#ab6bb3da371d3730a6552e93a9b2eab78"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChaseLEDs.html#a8745fa6b9f33b6c6274a563dd4dea786">loop</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChaseLEDs.html#aed060c51bb63dd8065be89f895989700">advanceTime</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</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><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChaseLEDs.html#af560270f72302c19fb7f95002089c9d7">setAdvanceTime</a> (unsigned long advanceTime)</td></tr>
<tr><td class="mdescLeft">&#160;</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><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChaseLEDs.html#aa0f4e0bd07dd65ee5574e894a612486b">advance</a> (uint8_t prevPin, uint8_t nextPin)</td></tr>
<tr><td class="mdescLeft">&#160;</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><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525">previousPin</a> (int n) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the pin that is <em>n</em> steps back in the sequence. <a href="#a27c460fcb341c2dc2fcf9341616eb525"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>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"><pre class="fragment"> uint8_t pins[] = {3, 5, 6, 9, 10, 11};
<a class="code" href="classChaseLEDs.html" title="Chase LED&#39;s on output pins in a defined sequence.">ChaseLEDs</a> chaser(pins, <span class="keyword">sizeof</span>(pins), 150);
<span class="keywordtype">void</span> <a class="code" href="classChaseLEDs.html#a8745fa6b9f33b6c6274a563dd4dea786">loop</a>() {
chaser.loop();
}
</pre></div><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"><pre class="fragment"> uint8_t pins[] = {3, 5, 6, 9, 10, 11, 10, 9, 6, 5};
<a class="code" href="classChaseLEDs.html" title="Chase LED&#39;s on output pins in a defined sequence.">ChaseLEDs</a> chaser(pins, <span class="keyword">sizeof</span>(pins), 150);
</pre></div><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&#39;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><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ab6bb3da371d3730a6552e93a9b2eab78"></a><!-- doxytag: member="ChaseLEDs::ChaseLEDs" ref="ab6bb3da371d3730a6552e93a9b2eab78" args="(const uint8_t *pins, int num, unsigned long advanceTime)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ChaseLEDs::ChaseLEDs </td>
<td>(</td>
<td class="paramtype">const uint8_t *&#160;</td>
<td class="paramname"><em>pins</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>num</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned long&#160;</td>
<td class="paramname"><em>advanceTime</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initializes the LED chaser. </p>
<p>The chase sequence consists of <em>num</em> pins, whose names are given by the <em>pins</em> array. Each LED is lit for <em>advanceTime</em> milliseconds before advancing to the next LED.</p>
<p>This constructor configures all of the pins for output and sets their state to be LOW. The first LED will be lit when the program first calls <a class="el" href="classChaseLEDs.html#a8745fa6b9f33b6c6274a563dd4dea786">loop()</a>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classChaseLEDs.html#a8745fa6b9f33b6c6274a563dd4dea786">loop()</a> </dd></dl>
<p>Definition at line <a class="el" href="ChaseLEDs_8cpp_source.html#l00071">71</a> of file <a class="el" href="ChaseLEDs_8cpp_source.html">ChaseLEDs.cpp</a>.</p>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="aa0f4e0bd07dd65ee5574e894a612486b"></a><!-- doxytag: member="ChaseLEDs::advance" ref="aa0f4e0bd07dd65ee5574e894a612486b" args="(uint8_t prevPin, uint8_t nextPin)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ChaseLEDs::advance </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>prevPin</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>nextPin</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [protected, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Advances to the next LED in sequence, turning off <em>prevPin</em>, and turning on <em>nextPin</em>. </p>
<p>The default implementation is equivalent to the following code:</p>
<div class="fragment"><pre class="fragment"> digitalWrite(prevPin, LOW);
digitalWrite(nextPin, HIGH);
</pre></div><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="see"><dt><b>See also:</b></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>
</div>
</div>
<a class="anchor" id="aed060c51bb63dd8065be89f895989700"></a><!-- doxytag: member="ChaseLEDs::advanceTime" ref="aed060c51bb63dd8065be89f895989700" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned long ChaseLEDs::advanceTime </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the number of milliseconds that each LED will be lit in the chase sequence. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classChaseLEDs.html#af560270f72302c19fb7f95002089c9d7" title="Sets the number of milliseconds to advance between LED&#39;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>
</div>
</div>
<a class="anchor" id="a8745fa6b9f33b6c6274a563dd4dea786"></a><!-- doxytag: member="ChaseLEDs::loop" ref="a8745fa6b9f33b6c6274a563dd4dea786" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ChaseLEDs::loop </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Perform a single iteration of the control loop for this LED chaser. </p>
<p>Definition at line <a class="el" href="ChaseLEDs_8cpp_source.html#l00087">87</a> of file <a class="el" href="ChaseLEDs_8cpp_source.html">ChaseLEDs.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a27c460fcb341c2dc2fcf9341616eb525"></a><!-- doxytag: member="ChaseLEDs::previousPin" ref="a27c460fcb341c2dc2fcf9341616eb525" args="(int n) const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint8_t ChaseLEDs::previousPin </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>n</em></td><td>)</td>
<td> const<code> [inline, protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<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>For example, the following code implements a LED chaser that lights two pins at a time:</p>
<div class="fragment"><pre class="fragment"> <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)
{
digitalWrite(<a class="code" href="classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525" title="Returns the pin that is n steps back in the sequence.">previousPin</a>(2), LOW);
digitalWrite(prevPin, HIGH);
digitalWrite(nextPin, HIGH);
}
</pre></div><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"><pre class="fragment"> <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)
{
digitalWrite(<a class="code" href="classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525" title="Returns the pin that is n steps back in the sequence.">previousPin</a>(2), LOW);
analogWrite(prevPin, 32);
digitalWrite(nextPin, HIGH);
}
</pre></div><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="see"><dt><b>See also:</b></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>
</div>
</div>
<a class="anchor" id="af560270f72302c19fb7f95002089c9d7"></a><!-- doxytag: member="ChaseLEDs::setAdvanceTime" ref="af560270f72302c19fb7f95002089c9d7" args="(unsigned long advanceTime)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ChaseLEDs::setAdvanceTime </td>
<td>(</td>
<td class="paramtype">unsigned long&#160;</td>
<td class="paramname"><em>advanceTime</em></td><td>)</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the number of milliseconds to advance between LED's to <em>advanceTime</em>. </p>
<dl class="see"><dt><b>See also:</b></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>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="ChaseLEDs_8h_source.html">ChaseLEDs.h</a></li>
<li><a class="el" href="ChaseLEDs_8cpp_source.html">ChaseLEDs.cpp</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

108
classDS1307RTC-members.html Normal file
View File

@ -0,0 +1,108 @@
<!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"/>
<title>ArduinoLibs: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">DS1307RTC Member List</div> </div>
</div>
<div class="contents">
This is the complete list of members for <a class="el" href="classDS1307RTC.html">DS1307RTC</a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="classRTC.html#adc29d7c43efc5a192d21965da5c3ee1d">adjustDays</a>(RTCDate *date, uint8_t flags)</td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [static]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#aeca597e6e37a05716e664242f9cfc5f4">adjustMonths</a>(RTCDate *date, uint8_t flags)</td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [static]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#a31d10cb2f7cac8839bd4be2d858b802d">adjustYears</a>(RTCDate *date, uint8_t flags)</td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [static]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#aee5ae8f600ee5296e65635c0d836fca3">ALARM_COUNT</a></td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [static]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classDS1307RTC.html#a93c25269a9b78ab3331354db26672248">byteCount</a>() const </td><td><a class="el" href="classDS1307RTC.html">DS1307RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#a05b1bd1479afc80682abdd4f3e58dc6f">DECREMENT</a></td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [static]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classDS1307RTC.html#a092805d75bea323dc4be062638bff866">DS1307RTC</a>(I2CMaster &amp;bus, uint8_t oneHzPin=255)</td><td><a class="el" href="classDS1307RTC.html">DS1307RTC</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classDS1307RTC.html#a6fec8ff71f33cc1a129eb0bd009600b0">hasUpdates</a>()</td><td><a class="el" href="classDS1307RTC.html">DS1307RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#aacbe3ebbf893685950b05327c11d5c37">INCREMENT</a></td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [static]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classDS1307RTC.html#aba01ca4c2f7863b610e5dfe9146886bd">isRealTime</a>() const </td><td><a class="el" href="classDS1307RTC.html">DS1307RTC</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classDS1307RTC.html#aab608eb1630520ee122306b721fdc47a">readAlarm</a>(uint8_t alarmNum, RTCAlarm *value)</td><td><a class="el" href="classDS1307RTC.html">DS1307RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classDS1307RTC.html#a7364609a201022688778ab116c3e4f4a">readByte</a>(uint8_t offset)</td><td><a class="el" href="classDS1307RTC.html">DS1307RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classDS1307RTC.html#a6fb56d1690bc30e7995961a5b5e5fdc4">readDate</a>(RTCDate *value)</td><td><a class="el" href="classDS1307RTC.html">DS1307RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classDS1307RTC.html#acd9800d6df2244b8e4e790480a1d62a6">readTime</a>(RTCTime *value)</td><td><a class="el" href="classDS1307RTC.html">DS1307RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#ada31c5120d18d2dd2863b3d440308da2">RTC</a>()</td><td><a class="el" href="classRTC.html">RTC</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#a02ace2d775063be9a99035851c9274eb">WRAP</a></td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [static]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classDS1307RTC.html#a7354aed91d7c94d0d7b2144b1bf32c75">writeAlarm</a>(uint8_t alarmNum, const RTCAlarm *value)</td><td><a class="el" href="classDS1307RTC.html">DS1307RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classDS1307RTC.html#a6ef435fd4aa4adf8eefdf8b1741f5ba6">writeByte</a>(uint8_t offset, uint8_t value)</td><td><a class="el" href="classDS1307RTC.html">DS1307RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classDS1307RTC.html#a4f7346be33612cf9ecd96080eb046230">writeDate</a>(const RTCDate *value)</td><td><a class="el" href="classDS1307RTC.html">DS1307RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classDS1307RTC.html#a0a5d0d86a0345420ebb289ea724b19e8">writeTime</a>(const RTCTime *value)</td><td><a class="el" href="classDS1307RTC.html">DS1307RTC</a></td><td><code> [virtual]</code></td></tr>
<tr bgcolor="#f0f0f0"><td><b>~RTC</b>() (defined in <a class="el" href="classRTC.html">RTC</a>)</td><td><a class="el" href="classRTC.html">RTC</a></td><td></td></tr>
</table></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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

456
classDS1307RTC.html Normal file
View File

@ -0,0 +1,456 @@
<!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"/>
<title>ArduinoLibs: DS1307RTC Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> </div>
<div class="headertitle">
<div class="title">DS1307RTC Class Reference</div> </div>
</div>
<div class="contents">
<!-- doxytag: class="DS1307RTC" --><!-- doxytag: inherits="RTC" -->
<p>Communicates with a DS1307 realtime clock chip via I2C.
<a href="classDS1307RTC.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="DS1307RTC_8h_source.html">DS1307RTC.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for DS1307RTC:</div>
<div class="dyncontent">
<div class="center">
<img src="classDS1307RTC.png" usemap="#DS1307RTC_map" alt=""/>
<map id="DS1307RTC_map" name="DS1307RTC_map">
<area href="classRTC.html" title="Base class for realtime clock handlers." alt="RTC" shape="rect" coords="0,0,81,24"/>
</map>
</div></div>
<p><a href="classDS1307RTC-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS1307RTC.html#a092805d75bea323dc4be062638bff866">DS1307RTC</a> (<a class="el" href="classI2CMaster.html">I2CMaster</a> &amp;bus, uint8_t oneHzPin=255)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Attaches to a realtime clock slave device on <em>bus</em>. <a href="#a092805d75bea323dc4be062638bff866"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aba01ca4c2f7863b610e5dfe9146886bd"></a><!-- doxytag: member="DS1307RTC::isRealTime" ref="aba01ca4c2f7863b610e5dfe9146886bd" args="() const " -->
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS1307RTC.html#aba01ca4c2f7863b610e5dfe9146886bd">isRealTime</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the realtime clock is on the I2C bus; false if the time and date are simulated. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS1307RTC.html#a6fec8ff71f33cc1a129eb0bd009600b0">hasUpdates</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the realtime clock has updated since the last call to this function. <a href="#a6fec8ff71f33cc1a129eb0bd009600b0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS1307RTC.html#acd9800d6df2244b8e4e790480a1d62a6">readTime</a> (<a class="el" href="structRTCTime.html">RTCTime</a> *value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the current time from the realtime clock into <em>value</em>. <a href="#acd9800d6df2244b8e4e790480a1d62a6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS1307RTC.html#a6fb56d1690bc30e7995961a5b5e5fdc4">readDate</a> (<a class="el" href="structRTCDate.html">RTCDate</a> *value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the current date from the realtime clock into <em>value</em>. <a href="#a6fb56d1690bc30e7995961a5b5e5fdc4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS1307RTC.html#a0a5d0d86a0345420ebb289ea724b19e8">writeTime</a> (const <a class="el" href="structRTCTime.html">RTCTime</a> *value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the time in the realtime clock to match <em>value</em>. <a href="#a0a5d0d86a0345420ebb289ea724b19e8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS1307RTC.html#a4f7346be33612cf9ecd96080eb046230">writeDate</a> (const <a class="el" href="structRTCDate.html">RTCDate</a> *value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the date in the realtime clock to match <em>value</em>. <a href="#a4f7346be33612cf9ecd96080eb046230"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS1307RTC.html#aab608eb1630520ee122306b721fdc47a">readAlarm</a> (uint8_t alarmNum, <a class="el" href="structRTCAlarm.html">RTCAlarm</a> *value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the details of the alarm with index <em>alarmNum</em> into <em>value</em>. <a href="#aab608eb1630520ee122306b721fdc47a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS1307RTC.html#a7354aed91d7c94d0d7b2144b1bf32c75">writeAlarm</a> (uint8_t alarmNum, const <a class="el" href="structRTCAlarm.html">RTCAlarm</a> *value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the details of the alarm with index <em>alarmNum</em> from <em>value</em>. <a href="#a7354aed91d7c94d0d7b2144b1bf32c75"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS1307RTC.html#a93c25269a9b78ab3331354db26672248">byteCount</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings, excluding storage used by alarms. <a href="#a93c25269a9b78ab3331354db26672248"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS1307RTC.html#a7364609a201022688778ab116c3e4f4a">readByte</a> (uint8_t offset)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the byte at <em>offset</em> within the realtime clock's non-volatile memory. <a href="#a7364609a201022688778ab116c3e4f4a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS1307RTC.html#a6ef435fd4aa4adf8eefdf8b1741f5ba6">writeByte</a> (uint8_t offset, uint8_t value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes <em>value</em> to <em>offset</em> within the realtime clock's non-volatile memory. <a href="#a6ef435fd4aa4adf8eefdf8b1741f5ba6"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Communicates with a DS1307 realtime clock chip via I2C. </p>
<p>This class simplifies the process of reading and writing the time and date information in a DS1307 realtime clock chip. The class also provides support for reading and writing information about alarms and other clock settings.</p>
<p>If there is no DS1307 chip on the I2C bus, this class will fall back to the <a class="el" href="classRTC.html" title="Base class for realtime clock handlers.">RTC</a> class to simulate the current time and date based on the value of millis().</p>
<p>The DS1307 uses a 2-digit year so this class is limited to dates between 2000 and 2099 inclusive.</p>
<p>Note: if this class has not been used with the DS1307 chip before, then the contents of NVRAM will be cleared. Any previous contents will be lost.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classRTC.html" title="Base class for realtime clock handlers.">RTC</a>, <a class="el" href="classDS3232RTC.html" title="Communicates with a DS3232 realtime clock chip via I2C.">DS3232RTC</a> </dd></dl>
<p>Definition at line <a class="el" href="DS1307RTC_8h_source.html#l00030">30</a> of file <a class="el" href="DS1307RTC_8h_source.html">DS1307RTC.h</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a092805d75bea323dc4be062638bff866"></a><!-- doxytag: member="DS1307RTC::DS1307RTC" ref="a092805d75bea323dc4be062638bff866" args="(I2CMaster &amp;bus, uint8_t oneHzPin=255)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">DS1307RTC::DS1307RTC </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classI2CMaster.html">I2CMaster</a> &amp;&#160;</td>
<td class="paramname"><em>bus</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>oneHzPin</em> = <code>255</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Attaches to a realtime clock slave device on <em>bus</em>. </p>
<p>If <em>oneHzPin</em> is not 255, then it indicates a digital input pin that is connected to the 1 Hz square wave output on the realtime clock. This input is used by <a class="el" href="classDS1307RTC.html#a6fec8ff71f33cc1a129eb0bd009600b0" title="Returns true if the realtime clock has updated since the last call to this function.">hasUpdates()</a> to determine if the time information has changed in a non-trivial manner.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classDS1307RTC.html#a6fec8ff71f33cc1a129eb0bd009600b0" title="Returns true if the realtime clock has updated since the last call to this function.">hasUpdates()</a> </dd></dl>
<p>Definition at line <a class="el" href="DS1307RTC_8cpp_source.html#l00083">83</a> of file <a class="el" href="DS1307RTC_8cpp_source.html">DS1307RTC.cpp</a>.</p>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a93c25269a9b78ab3331354db26672248"></a><!-- doxytag: member="DS1307RTC::byteCount" ref="a93c25269a9b78ab3331354db26672248" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int DS1307RTC::byteCount </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings, excluding storage used by alarms. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classDS1307RTC.html#a7364609a201022688778ab116c3e4f4a" title="Reads the byte at offset within the realtime clock&#39;s non-volatile memory.">readByte()</a>, <a class="el" href="classDS1307RTC.html#a6ef435fd4aa4adf8eefdf8b1741f5ba6" title="Writes value to offset within the realtime clock&#39;s non-volatile memory.">writeByte()</a> </dd></dl>
<p>Reimplemented from <a class="el" href="classRTC.html#acfdebfb449710e44e11f9a3675e14fd8">RTC</a>.</p>
<p>Definition at line <a class="el" href="DS1307RTC_8cpp_source.html#l00264">264</a> of file <a class="el" href="DS1307RTC_8cpp_source.html">DS1307RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a6fec8ff71f33cc1a129eb0bd009600b0"></a><!-- doxytag: member="DS1307RTC::hasUpdates" ref="a6fec8ff71f33cc1a129eb0bd009600b0" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool DS1307RTC::hasUpdates </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns true if the realtime clock has updated since the last call to this function. </p>
<p>The default implementation returns true, indicating that an update is always available to be read. </p>
<p>Reimplemented from <a class="el" href="classRTC.html#a3690761f29654a2c9e676fcbfa32dd30">RTC</a>.</p>
<p>Definition at line <a class="el" href="DS1307RTC_8cpp_source.html#l00118">118</a> of file <a class="el" href="DS1307RTC_8cpp_source.html">DS1307RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aab608eb1630520ee122306b721fdc47a"></a><!-- doxytag: member="DS1307RTC::readAlarm" ref="aab608eb1630520ee122306b721fdc47a" args="(uint8_t alarmNum, RTCAlarm *value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void DS1307RTC::readAlarm </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>alarmNum</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structRTCAlarm.html">RTCAlarm</a> *&#160;</td>
<td class="paramname"><em>value</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reads the details of the alarm with index <em>alarmNum</em> into <em>value</em>. </p>
<p>The <em>alarmNum</em> parameter must be between 0 and <a class="el" href="classRTC.html#aee5ae8f600ee5296e65635c0d836fca3">ALARM_COUNT</a> - 1.</p>
<p>Alarm details are stored at the end of the realtime clock's non-volatile memory.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classDS1307RTC.html#a7354aed91d7c94d0d7b2144b1bf32c75" title="Updates the details of the alarm with index alarmNum from value.">writeAlarm()</a>, alarmCount() </dd></dl>
<p>Reimplemented from <a class="el" href="classRTC.html#ade282d7a60147c3f0269f1fcd59c8d66">RTC</a>.</p>
<p>Definition at line <a class="el" href="DS1307RTC_8cpp_source.html#l00230">230</a> of file <a class="el" href="DS1307RTC_8cpp_source.html">DS1307RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a7364609a201022688778ab116c3e4f4a"></a><!-- doxytag: member="DS1307RTC::readByte" ref="a7364609a201022688778ab116c3e4f4a" args="(uint8_t offset)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint8_t DS1307RTC::readByte </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>offset</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reads the byte at <em>offset</em> within the realtime clock's non-volatile memory. </p>
<p>The <em>offset</em> parameter must be between 0 and <a class="el" href="classDS1307RTC.html#a93c25269a9b78ab3331354db26672248" title="Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings...">byteCount()</a> - 1.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classDS1307RTC.html#a6ef435fd4aa4adf8eefdf8b1741f5ba6" title="Writes value to offset within the realtime clock&#39;s non-volatile memory.">writeByte()</a>, <a class="el" href="classDS1307RTC.html#a93c25269a9b78ab3331354db26672248" title="Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings...">byteCount()</a> </dd></dl>
<p>Reimplemented from <a class="el" href="classRTC.html#a0f47b10b436e3f9d36e04ec907579431">RTC</a>.</p>
<p>Definition at line <a class="el" href="DS1307RTC_8cpp_source.html#l00269">269</a> of file <a class="el" href="DS1307RTC_8cpp_source.html">DS1307RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a6fb56d1690bc30e7995961a5b5e5fdc4"></a><!-- doxytag: member="DS1307RTC::readDate" ref="a6fb56d1690bc30e7995961a5b5e5fdc4" args="(RTCDate *value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void DS1307RTC::readDate </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structRTCDate.html">RTCDate</a> *&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reads the current date from the realtime clock into <em>value</em>. </p>
<p>The time should be read first with <a class="el" href="classDS1307RTC.html#acd9800d6df2244b8e4e790480a1d62a6" title="Reads the current time from the realtime clock into value.">readTime()</a> as the default implementation only advances the date when the time is read and it crosses midnight.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classDS1307RTC.html#a4f7346be33612cf9ecd96080eb046230" title="Updates the date in the realtime clock to match value.">writeDate()</a>, <a class="el" href="classDS1307RTC.html#acd9800d6df2244b8e4e790480a1d62a6" title="Reads the current time from the realtime clock into value.">readTime()</a> </dd></dl>
<p>Reimplemented from <a class="el" href="classRTC.html#aa1e21bf42ebd4456919744ae0f4f631e">RTC</a>.</p>
<p>Definition at line <a class="el" href="DS1307RTC_8cpp_source.html#l00177">177</a> of file <a class="el" href="DS1307RTC_8cpp_source.html">DS1307RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="acd9800d6df2244b8e4e790480a1d62a6"></a><!-- doxytag: member="DS1307RTC::readTime" ref="acd9800d6df2244b8e4e790480a1d62a6" args="(RTCTime *value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void DS1307RTC::readTime </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structRTCTime.html">RTCTime</a> *&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reads the current time from the realtime clock into <em>value</em>. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classDS1307RTC.html#a0a5d0d86a0345420ebb289ea724b19e8" title="Updates the time in the realtime clock to match value.">writeTime()</a>, <a class="el" href="classDS1307RTC.html#a6fb56d1690bc30e7995961a5b5e5fdc4" title="Reads the current date from the realtime clock into value.">readDate()</a> </dd></dl>
<p>Reimplemented from <a class="el" href="classRTC.html#aaf0a5c1f32f210a49718d148620b5bec">RTC</a>.</p>
<p>Definition at line <a class="el" href="DS1307RTC_8cpp_source.html#l00157">157</a> of file <a class="el" href="DS1307RTC_8cpp_source.html">DS1307RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a7354aed91d7c94d0d7b2144b1bf32c75"></a><!-- doxytag: member="DS1307RTC::writeAlarm" ref="a7354aed91d7c94d0d7b2144b1bf32c75" args="(uint8_t alarmNum, const RTCAlarm *value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void DS1307RTC::writeAlarm </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>alarmNum</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="structRTCAlarm.html">RTCAlarm</a> *&#160;</td>
<td class="paramname"><em>value</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Updates the details of the alarm with index <em>alarmNum</em> from <em>value</em>. </p>
<p>The <em>alarmNum</em> parameter must be between 0 and <a class="el" href="classRTC.html#aee5ae8f600ee5296e65635c0d836fca3">ALARM_COUNT</a> - 1.</p>
<p>Alarm details are stored at the end of the realtime clock's non-volatile memory.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classDS1307RTC.html#aab608eb1630520ee122306b721fdc47a" title="Reads the details of the alarm with index alarmNum into value.">readAlarm()</a>, alarmCount() </dd></dl>
<p>Reimplemented from <a class="el" href="classRTC.html#a0e96c91efd9e7a6340effdae3eadf17e">RTC</a>.</p>
<p>Definition at line <a class="el" href="DS1307RTC_8cpp_source.html#l00250">250</a> of file <a class="el" href="DS1307RTC_8cpp_source.html">DS1307RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a6ef435fd4aa4adf8eefdf8b1741f5ba6"></a><!-- doxytag: member="DS1307RTC::writeByte" ref="a6ef435fd4aa4adf8eefdf8b1741f5ba6" args="(uint8_t offset, uint8_t value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void DS1307RTC::writeByte </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>offset</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>value</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Writes <em>value</em> to <em>offset</em> within the realtime clock's non-volatile memory. </p>
<p>The <em>offset</em> parameter must be between 0 and <a class="el" href="classDS1307RTC.html#a93c25269a9b78ab3331354db26672248" title="Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings...">byteCount()</a> - 1.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classDS1307RTC.html#a7364609a201022688778ab116c3e4f4a" title="Reads the byte at offset within the realtime clock&#39;s non-volatile memory.">readByte()</a>, <a class="el" href="classDS1307RTC.html#a93c25269a9b78ab3331354db26672248" title="Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings...">byteCount()</a> </dd></dl>
<p>Reimplemented from <a class="el" href="classRTC.html#a1cab6397ec04b1e2b3feea5b3cd1f749">RTC</a>.</p>
<p>Definition at line <a class="el" href="DS1307RTC_8cpp_source.html#l00277">277</a> of file <a class="el" href="DS1307RTC_8cpp_source.html">DS1307RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a4f7346be33612cf9ecd96080eb046230"></a><!-- doxytag: member="DS1307RTC::writeDate" ref="a4f7346be33612cf9ecd96080eb046230" args="(const RTCDate *value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void DS1307RTC::writeDate </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="structRTCDate.html">RTCDate</a> *&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Updates the date in the realtime clock to match <em>value</em>. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classDS1307RTC.html#a6fb56d1690bc30e7995961a5b5e5fdc4" title="Reads the current date from the realtime clock into value.">readDate()</a>, <a class="el" href="classDS1307RTC.html#a0a5d0d86a0345420ebb289ea724b19e8" title="Updates the time in the realtime clock to match value.">writeTime()</a> </dd></dl>
<p>Reimplemented from <a class="el" href="classRTC.html#ae667600d05c8e7b06a93574dd068a4d7">RTC</a>.</p>
<p>Definition at line <a class="el" href="DS1307RTC_8cpp_source.html#l00216">216</a> of file <a class="el" href="DS1307RTC_8cpp_source.html">DS1307RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a0a5d0d86a0345420ebb289ea724b19e8"></a><!-- doxytag: member="DS1307RTC::writeTime" ref="a0a5d0d86a0345420ebb289ea724b19e8" args="(const RTCTime *value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void DS1307RTC::writeTime </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="structRTCTime.html">RTCTime</a> *&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Updates the time in the realtime clock to match <em>value</em>. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classDS1307RTC.html#acd9800d6df2244b8e4e790480a1d62a6" title="Reads the current time from the realtime clock into value.">readTime()</a>, <a class="el" href="classDS1307RTC.html#a4f7346be33612cf9ecd96080eb046230" title="Updates the date in the realtime clock to match value.">writeDate()</a> </dd></dl>
<p>Reimplemented from <a class="el" href="classRTC.html#a102e2ec15bf0273d8f7e9ce4b6dcc96e">RTC</a>.</p>
<p>Definition at line <a class="el" href="DS1307RTC_8cpp_source.html#l00202">202</a> of file <a class="el" href="DS1307RTC_8cpp_source.html">DS1307RTC.cpp</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="DS1307RTC_8h_source.html">DS1307RTC.h</a></li>
<li><a class="el" href="DS1307RTC_8cpp_source.html">DS1307RTC.cpp</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

BIN
classDS1307RTC.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

113
classDS3232RTC-members.html Normal file
View File

@ -0,0 +1,113 @@
<!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"/>
<title>ArduinoLibs: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">DS3232RTC Member List</div> </div>
</div>
<div class="contents">
This is the complete list of members for <a class="el" href="classDS3232RTC.html">DS3232RTC</a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="classRTC.html#adc29d7c43efc5a192d21965da5c3ee1d">adjustDays</a>(RTCDate *date, uint8_t flags)</td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [static]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#aeca597e6e37a05716e664242f9cfc5f4">adjustMonths</a>(RTCDate *date, uint8_t flags)</td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [static]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#a31d10cb2f7cac8839bd4be2d858b802d">adjustYears</a>(RTCDate *date, uint8_t flags)</td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [static]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#aee5ae8f600ee5296e65635c0d836fca3">ALARM_COUNT</a></td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [static]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classDS3232RTC.html#a1319fe936dcb7e9d6bdf200b77a94f8e">byteCount</a>() const </td><td><a class="el" href="classDS3232RTC.html">DS3232RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#a05b1bd1479afc80682abdd4f3e58dc6f">DECREMENT</a></td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [static]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classDS3232RTC.html#ada732bae42fc2833e59ae293aa27ddcb">disable32kHzOutput</a>()</td><td><a class="el" href="classDS3232RTC.html">DS3232RTC</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classDS3232RTC.html#a225b8c62d617aa1b7be7d20e8a033be9">disableAlarmInterrupts</a>()</td><td><a class="el" href="classDS3232RTC.html">DS3232RTC</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classDS3232RTC.html#aa959454ae01b11c48d6ec7ec192b4ccb">DS3232RTC</a>(I2CMaster &amp;bus, uint8_t oneHzPin=255)</td><td><a class="el" href="classDS3232RTC.html">DS3232RTC</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classDS3232RTC.html#a3966de6f4241d86f198a8b9dd5e7e59a">enable32kHzOutput</a>()</td><td><a class="el" href="classDS3232RTC.html">DS3232RTC</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classDS3232RTC.html#ab91e79271a1f8e75b07bddbb04445dc9">enableAlarmInterrupts</a>()</td><td><a class="el" href="classDS3232RTC.html">DS3232RTC</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classDS3232RTC.html#a79649f100a4562b9c1ba7c69e85cbca3">firedAlarm</a>()</td><td><a class="el" href="classDS3232RTC.html">DS3232RTC</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classDS3232RTC.html#a619ffee1bc013c9ddf4ae415115798bc">hasUpdates</a>()</td><td><a class="el" href="classDS3232RTC.html">DS3232RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#aacbe3ebbf893685950b05327c11d5c37">INCREMENT</a></td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [static]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classDS3232RTC.html#acc5908a3743afb4c26bd75e22cad87a4">isRealTime</a>() const </td><td><a class="el" href="classDS3232RTC.html">DS3232RTC</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classDS3232RTC.html#a09c7073c687dcbbc423baf48074c7873">readAlarm</a>(uint8_t alarmNum, RTCAlarm *value)</td><td><a class="el" href="classDS3232RTC.html">DS3232RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classDS3232RTC.html#a5ba83a3ef7d65d45c2f3241afdd8fef7">readByte</a>(uint8_t offset)</td><td><a class="el" href="classDS3232RTC.html">DS3232RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classDS3232RTC.html#ab03358e3b5996e38d766e2f9f6ab62ca">readDate</a>(RTCDate *value)</td><td><a class="el" href="classDS3232RTC.html">DS3232RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classDS3232RTC.html#af89e68c68f1c4b7e94286f800b5b2747">readTime</a>(RTCTime *value)</td><td><a class="el" href="classDS3232RTC.html">DS3232RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#ada31c5120d18d2dd2863b3d440308da2">RTC</a>()</td><td><a class="el" href="classRTC.html">RTC</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#a02ace2d775063be9a99035851c9274eb">WRAP</a></td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [static]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classDS3232RTC.html#a8b0a65e0ac479aec8fad6ca3147dbe75">writeAlarm</a>(uint8_t alarmNum, const RTCAlarm *value)</td><td><a class="el" href="classDS3232RTC.html">DS3232RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classDS3232RTC.html#a9acebf12c5cecdd6d84e0ff9ed41765a">writeByte</a>(uint8_t offset, uint8_t value)</td><td><a class="el" href="classDS3232RTC.html">DS3232RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classDS3232RTC.html#a31c004a90c724979d8267c31f2dbf5ed">writeDate</a>(const RTCDate *value)</td><td><a class="el" href="classDS3232RTC.html">DS3232RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classDS3232RTC.html#ab0ca13a8b80da856b37fc53b84e27c78">writeTime</a>(const RTCTime *value)</td><td><a class="el" href="classDS3232RTC.html">DS3232RTC</a></td><td><code> [virtual]</code></td></tr>
<tr bgcolor="#f0f0f0"><td><b>~RTC</b>() (defined in <a class="el" href="classRTC.html">RTC</a>)</td><td><a class="el" href="classRTC.html">RTC</a></td><td></td></tr>
</table></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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

578
classDS3232RTC.html Normal file
View File

@ -0,0 +1,578 @@
<!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"/>
<title>ArduinoLibs: DS3232RTC Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> </div>
<div class="headertitle">
<div class="title">DS3232RTC Class Reference</div> </div>
</div>
<div class="contents">
<!-- doxytag: class="DS3232RTC" --><!-- doxytag: inherits="RTC" -->
<p>Communicates with a DS3232 realtime clock chip via I2C.
<a href="classDS3232RTC.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="DS3232RTC_8h_source.html">DS3232RTC.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for DS3232RTC:</div>
<div class="dyncontent">
<div class="center">
<img src="classDS3232RTC.png" usemap="#DS3232RTC_map" alt=""/>
<map id="DS3232RTC_map" name="DS3232RTC_map">
<area href="classRTC.html" title="Base class for realtime clock handlers." alt="RTC" shape="rect" coords="0,0,81,24"/>
</map>
</div></div>
<p><a href="classDS3232RTC-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS3232RTC.html#aa959454ae01b11c48d6ec7ec192b4ccb">DS3232RTC</a> (<a class="el" href="classI2CMaster.html">I2CMaster</a> &amp;bus, uint8_t oneHzPin=255)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Attaches to a realtime clock slave device on <em>bus</em>. <a href="#aa959454ae01b11c48d6ec7ec192b4ccb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acc5908a3743afb4c26bd75e22cad87a4"></a><!-- doxytag: member="DS3232RTC::isRealTime" ref="acc5908a3743afb4c26bd75e22cad87a4" args="() const " -->
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS3232RTC.html#acc5908a3743afb4c26bd75e22cad87a4">isRealTime</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the realtime clock is on the I2C bus; false if the time and date are simulated. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS3232RTC.html#a619ffee1bc013c9ddf4ae415115798bc">hasUpdates</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the realtime clock has updated since the last call to this function. <a href="#a619ffee1bc013c9ddf4ae415115798bc"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS3232RTC.html#af89e68c68f1c4b7e94286f800b5b2747">readTime</a> (<a class="el" href="structRTCTime.html">RTCTime</a> *value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the current time from the realtime clock into <em>value</em>. <a href="#af89e68c68f1c4b7e94286f800b5b2747"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS3232RTC.html#ab03358e3b5996e38d766e2f9f6ab62ca">readDate</a> (<a class="el" href="structRTCDate.html">RTCDate</a> *value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the current date from the realtime clock into <em>value</em>. <a href="#ab03358e3b5996e38d766e2f9f6ab62ca"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS3232RTC.html#ab0ca13a8b80da856b37fc53b84e27c78">writeTime</a> (const <a class="el" href="structRTCTime.html">RTCTime</a> *value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the time in the realtime clock to match <em>value</em>. <a href="#ab0ca13a8b80da856b37fc53b84e27c78"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS3232RTC.html#a31c004a90c724979d8267c31f2dbf5ed">writeDate</a> (const <a class="el" href="structRTCDate.html">RTCDate</a> *value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the date in the realtime clock to match <em>value</em>. <a href="#a31c004a90c724979d8267c31f2dbf5ed"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS3232RTC.html#a09c7073c687dcbbc423baf48074c7873">readAlarm</a> (uint8_t alarmNum, <a class="el" href="structRTCAlarm.html">RTCAlarm</a> *value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the details of the alarm with index <em>alarmNum</em> into <em>value</em>. <a href="#a09c7073c687dcbbc423baf48074c7873"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS3232RTC.html#a8b0a65e0ac479aec8fad6ca3147dbe75">writeAlarm</a> (uint8_t alarmNum, const <a class="el" href="structRTCAlarm.html">RTCAlarm</a> *value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the details of the alarm with index <em>alarmNum</em> from <em>value</em>. <a href="#a8b0a65e0ac479aec8fad6ca3147dbe75"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS3232RTC.html#a1319fe936dcb7e9d6bdf200b77a94f8e">byteCount</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings, excluding storage used by alarms. <a href="#a1319fe936dcb7e9d6bdf200b77a94f8e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS3232RTC.html#a5ba83a3ef7d65d45c2f3241afdd8fef7">readByte</a> (uint8_t offset)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the byte at <em>offset</em> within the realtime clock's non-volatile memory. <a href="#a5ba83a3ef7d65d45c2f3241afdd8fef7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS3232RTC.html#a9acebf12c5cecdd6d84e0ff9ed41765a">writeByte</a> (uint8_t offset, uint8_t value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes <em>value</em> to <em>offset</em> within the realtime clock's non-volatile memory. <a href="#a9acebf12c5cecdd6d84e0ff9ed41765a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS3232RTC.html#ab91e79271a1f8e75b07bddbb04445dc9">enableAlarmInterrupts</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables the generation of interrupts for alarms 0 and 1. <a href="#ab91e79271a1f8e75b07bddbb04445dc9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS3232RTC.html#a225b8c62d617aa1b7be7d20e8a033be9">disableAlarmInterrupts</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Disables the generation of interrupts for alarms 0 and 1. <a href="#a225b8c62d617aa1b7be7d20e8a033be9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS3232RTC.html#a79649f100a4562b9c1ba7c69e85cbca3">firedAlarm</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Determines which of alarms 0 or 1 have fired since the last call. <a href="#a79649f100a4562b9c1ba7c69e85cbca3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS3232RTC.html#a3966de6f4241d86f198a8b9dd5e7e59a">enable32kHzOutput</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables the 32 kHz output on the DS3232 chip. <a href="#a3966de6f4241d86f198a8b9dd5e7e59a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDS3232RTC.html#ada732bae42fc2833e59ae293aa27ddcb">disable32kHzOutput</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Disables the 32 kHz output on the DS3232 chip. <a href="#ada732bae42fc2833e59ae293aa27ddcb"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Communicates with a DS3232 realtime clock chip via I2C. </p>
<p>This class simplifies the process of reading and writing the time and date information in a DS3232 realtime clock chip. The class also provides support for reading and writing information about alarms and other clock settings.</p>
<p>If there is no DS3232 chip on the I2C bus, this class will fall back to the <a class="el" href="classRTC.html" title="Base class for realtime clock handlers.">RTC</a> class to simulate the current time and date based on the value of millis().</p>
<p>Alarms 0 and 1 can be set to generate an interrupt when they fire using <a class="el" href="classDS3232RTC.html#ab91e79271a1f8e75b07bddbb04445dc9" title="Enables the generation of interrupts for alarms 0 and 1.">enableAlarmInterrupts()</a>. The <a class="el" href="classDS3232RTC.html#a79649f100a4562b9c1ba7c69e85cbca3" title="Determines which of alarms 0 or 1 have fired since the last call.">firedAlarm()</a> function can be used to determine which alarm has fired. Alarms 2 and 3 cannot be monitored with interrupts.</p>
<p>The DS3232 uses a 2-digit year so this class is limited to dates between 2000 and 2099 inclusive.</p>
<p>Note: if this class has not been used with the DS3232 chip before, then the contents of NVRAM will be cleared. Any previous contents will be lost.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classRTC.html" title="Base class for realtime clock handlers.">RTC</a>, <a class="el" href="classDS1307RTC.html" title="Communicates with a DS1307 realtime clock chip via I2C.">DS1307RTC</a> </dd></dl>
<p>Definition at line <a class="el" href="DS3232RTC_8h_source.html#l00030">30</a> of file <a class="el" href="DS3232RTC_8h_source.html">DS3232RTC.h</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="aa959454ae01b11c48d6ec7ec192b4ccb"></a><!-- doxytag: member="DS3232RTC::DS3232RTC" ref="aa959454ae01b11c48d6ec7ec192b4ccb" args="(I2CMaster &amp;bus, uint8_t oneHzPin=255)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">DS3232RTC::DS3232RTC </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classI2CMaster.html">I2CMaster</a> &amp;&#160;</td>
<td class="paramname"><em>bus</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>oneHzPin</em> = <code>255</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Attaches to a realtime clock slave device on <em>bus</em>. </p>
<p>If <em>oneHzPin</em> is not 255, then it indicates a digital input pin that is connected to the 1 Hz square wave output on the realtime clock. This input is used by <a class="el" href="classDS3232RTC.html#a619ffee1bc013c9ddf4ae415115798bc" title="Returns true if the realtime clock has updated since the last call to this function.">hasUpdates()</a> to determine if the time information has changed in a non-trivial manner.</p>
<p>If you wish to use <a class="el" href="classDS3232RTC.html#ab91e79271a1f8e75b07bddbb04445dc9" title="Enables the generation of interrupts for alarms 0 and 1.">enableAlarmInterrupts()</a>, then <em>oneHzPin</em> must be 255.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classDS3232RTC.html#a619ffee1bc013c9ddf4ae415115798bc" title="Returns true if the realtime clock has updated since the last call to this function.">hasUpdates()</a>, <a class="el" href="classDS3232RTC.html#ab91e79271a1f8e75b07bddbb04445dc9" title="Enables the generation of interrupts for alarms 0 and 1.">enableAlarmInterrupts()</a> </dd></dl>
<p>Definition at line <a class="el" href="DS3232RTC_8cpp_source.html#l00126">126</a> of file <a class="el" href="DS3232RTC_8cpp_source.html">DS3232RTC.cpp</a>.</p>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a1319fe936dcb7e9d6bdf200b77a94f8e"></a><!-- doxytag: member="DS3232RTC::byteCount" ref="a1319fe936dcb7e9d6bdf200b77a94f8e" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int DS3232RTC::byteCount </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings, excluding storage used by alarms. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classDS3232RTC.html#a5ba83a3ef7d65d45c2f3241afdd8fef7" title="Reads the byte at offset within the realtime clock&#39;s non-volatile memory.">readByte()</a>, <a class="el" href="classDS3232RTC.html#a9acebf12c5cecdd6d84e0ff9ed41765a" title="Writes value to offset within the realtime clock&#39;s non-volatile memory.">writeByte()</a> </dd></dl>
<p>Reimplemented from <a class="el" href="classRTC.html#acfdebfb449710e44e11f9a3675e14fd8">RTC</a>.</p>
<p>Definition at line <a class="el" href="DS3232RTC_8cpp_source.html#l00335">335</a> of file <a class="el" href="DS3232RTC_8cpp_source.html">DS3232RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ada732bae42fc2833e59ae293aa27ddcb"></a><!-- doxytag: member="DS3232RTC::disable32kHzOutput" ref="ada732bae42fc2833e59ae293aa27ddcb" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void DS3232RTC::disable32kHzOutput </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Disables the 32 kHz output on the DS3232 chip. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classDS3232RTC.html#a3966de6f4241d86f198a8b9dd5e7e59a" title="Enables the 32 kHz output on the DS3232 chip.">enable32kHzOutput()</a> </dd></dl>
<p>Definition at line <a class="el" href="DS3232RTC_8cpp_source.html#l00448">448</a> of file <a class="el" href="DS3232RTC_8cpp_source.html">DS3232RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a225b8c62d617aa1b7be7d20e8a033be9"></a><!-- doxytag: member="DS3232RTC::disableAlarmInterrupts" ref="a225b8c62d617aa1b7be7d20e8a033be9" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void DS3232RTC::disableAlarmInterrupts </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Disables the generation of interrupts for alarms 0 and 1. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classDS3232RTC.html#ab91e79271a1f8e75b07bddbb04445dc9" title="Enables the generation of interrupts for alarms 0 and 1.">enableAlarmInterrupts()</a> </dd></dl>
<p>Definition at line <a class="el" href="DS3232RTC_8cpp_source.html#l00383">383</a> of file <a class="el" href="DS3232RTC_8cpp_source.html">DS3232RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a3966de6f4241d86f198a8b9dd5e7e59a"></a><!-- doxytag: member="DS3232RTC::enable32kHzOutput" ref="a3966de6f4241d86f198a8b9dd5e7e59a" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void DS3232RTC::enable32kHzOutput </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Enables the 32 kHz output on the DS3232 chip. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classDS3232RTC.html#ada732bae42fc2833e59ae293aa27ddcb" title="Disables the 32 kHz output on the DS3232 chip.">disable32kHzOutput()</a> </dd></dl>
<p>Definition at line <a class="el" href="DS3232RTC_8cpp_source.html#l00434">434</a> of file <a class="el" href="DS3232RTC_8cpp_source.html">DS3232RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ab91e79271a1f8e75b07bddbb04445dc9"></a><!-- doxytag: member="DS3232RTC::enableAlarmInterrupts" ref="ab91e79271a1f8e75b07bddbb04445dc9" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void DS3232RTC::enableAlarmInterrupts </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Enables the generation of interrupts for alarms 0 and 1. </p>
<p>When the interrupt occurs, use <a class="el" href="classDS3232RTC.html#a79649f100a4562b9c1ba7c69e85cbca3" title="Determines which of alarms 0 or 1 have fired since the last call.">firedAlarm()</a> to determine which alarm has fired. The application is responsible for implementing the interrupt service routine to watch for the interrupt.</p>
<p>Note: this function does nothing if the 1 Hz pin was enabled in the constructor, but <a class="el" href="classDS3232RTC.html#a79649f100a4562b9c1ba7c69e85cbca3" title="Determines which of alarms 0 or 1 have fired since the last call.">firedAlarm()</a> can still be used to determine which alarm has fired when <a class="el" href="classDS3232RTC.html#a619ffee1bc013c9ddf4ae415115798bc" title="Returns true if the realtime clock has updated since the last call to this function.">hasUpdates()</a> reports that there is an update available.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classDS3232RTC.html#a225b8c62d617aa1b7be7d20e8a033be9" title="Disables the generation of interrupts for alarms 0 and 1.">disableAlarmInterrupts()</a>, <a class="el" href="classDS3232RTC.html#a79649f100a4562b9c1ba7c69e85cbca3" title="Determines which of alarms 0 or 1 have fired since the last call.">firedAlarm()</a> </dd></dl>
<p>Definition at line <a class="el" href="DS3232RTC_8cpp_source.html#l00370">370</a> of file <a class="el" href="DS3232RTC_8cpp_source.html">DS3232RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a79649f100a4562b9c1ba7c69e85cbca3"></a><!-- doxytag: member="DS3232RTC::firedAlarm" ref="a79649f100a4562b9c1ba7c69e85cbca3" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int DS3232RTC::firedAlarm </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Determines which of alarms 0 or 1 have fired since the last call. </p>
<p>Returns 0 if alarm 0 has fired, 1 if alarm 1 has fired, 2 if both alarms have fired, or -1 if neither alarm has fired.</p>
<p>The fired alarm state will be cleared, ready for the next call.</p>
<p>This function cannot be used to determine if alarms 2 or 3 have fired as they are stored in NVRAM and are not handled specially by the DS3232.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classDS3232RTC.html#ab91e79271a1f8e75b07bddbb04445dc9" title="Enables the generation of interrupts for alarms 0 and 1.">enableAlarmInterrupts()</a> </dd></dl>
<p>Definition at line <a class="el" href="DS3232RTC_8cpp_source.html#l00406">406</a> of file <a class="el" href="DS3232RTC_8cpp_source.html">DS3232RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a619ffee1bc013c9ddf4ae415115798bc"></a><!-- doxytag: member="DS3232RTC::hasUpdates" ref="a619ffee1bc013c9ddf4ae415115798bc" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool DS3232RTC::hasUpdates </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns true if the realtime clock has updated since the last call to this function. </p>
<p>The default implementation returns true, indicating that an update is always available to be read. </p>
<p>Reimplemented from <a class="el" href="classRTC.html#a3690761f29654a2c9e676fcbfa32dd30">RTC</a>.</p>
<p>Definition at line <a class="el" href="DS3232RTC_8cpp_source.html#l00166">166</a> of file <a class="el" href="DS3232RTC_8cpp_source.html">DS3232RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a09c7073c687dcbbc423baf48074c7873"></a><!-- doxytag: member="DS3232RTC::readAlarm" ref="a09c7073c687dcbbc423baf48074c7873" args="(uint8_t alarmNum, RTCAlarm *value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void DS3232RTC::readAlarm </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>alarmNum</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structRTCAlarm.html">RTCAlarm</a> *&#160;</td>
<td class="paramname"><em>value</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reads the details of the alarm with index <em>alarmNum</em> into <em>value</em>. </p>
<p>The <em>alarmNum</em> parameter must be between 0 and <a class="el" href="classRTC.html#aee5ae8f600ee5296e65635c0d836fca3">ALARM_COUNT</a> - 1.</p>
<p>Alarm details are stored at the end of the realtime clock's non-volatile memory.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classDS3232RTC.html#a8b0a65e0ac479aec8fad6ca3147dbe75" title="Updates the details of the alarm with index alarmNum from value.">writeAlarm()</a>, alarmCount() </dd></dl>
<p>Reimplemented from <a class="el" href="classRTC.html#ade282d7a60147c3f0269f1fcd59c8d66">RTC</a>.</p>
<p>Definition at line <a class="el" href="DS3232RTC_8cpp_source.html#l00278">278</a> of file <a class="el" href="DS3232RTC_8cpp_source.html">DS3232RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a5ba83a3ef7d65d45c2f3241afdd8fef7"></a><!-- doxytag: member="DS3232RTC::readByte" ref="a5ba83a3ef7d65d45c2f3241afdd8fef7" args="(uint8_t offset)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint8_t DS3232RTC::readByte </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>offset</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reads the byte at <em>offset</em> within the realtime clock's non-volatile memory. </p>
<p>The <em>offset</em> parameter must be between 0 and <a class="el" href="classDS3232RTC.html#a1319fe936dcb7e9d6bdf200b77a94f8e" title="Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings...">byteCount()</a> - 1.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classDS3232RTC.html#a9acebf12c5cecdd6d84e0ff9ed41765a" title="Writes value to offset within the realtime clock&#39;s non-volatile memory.">writeByte()</a>, <a class="el" href="classDS3232RTC.html#a1319fe936dcb7e9d6bdf200b77a94f8e" title="Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings...">byteCount()</a> </dd></dl>
<p>Reimplemented from <a class="el" href="classRTC.html#a0f47b10b436e3f9d36e04ec907579431">RTC</a>.</p>
<p>Definition at line <a class="el" href="DS3232RTC_8cpp_source.html#l00340">340</a> of file <a class="el" href="DS3232RTC_8cpp_source.html">DS3232RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ab03358e3b5996e38d766e2f9f6ab62ca"></a><!-- doxytag: member="DS3232RTC::readDate" ref="ab03358e3b5996e38d766e2f9f6ab62ca" args="(RTCDate *value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void DS3232RTC::readDate </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structRTCDate.html">RTCDate</a> *&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reads the current date from the realtime clock into <em>value</em>. </p>
<p>The time should be read first with <a class="el" href="classDS3232RTC.html#af89e68c68f1c4b7e94286f800b5b2747" title="Reads the current time from the realtime clock into value.">readTime()</a> as the default implementation only advances the date when the time is read and it crosses midnight.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classDS3232RTC.html#a31c004a90c724979d8267c31f2dbf5ed" title="Updates the date in the realtime clock to match value.">writeDate()</a>, <a class="el" href="classDS3232RTC.html#af89e68c68f1c4b7e94286f800b5b2747" title="Reads the current time from the realtime clock into value.">readTime()</a> </dd></dl>
<p>Reimplemented from <a class="el" href="classRTC.html#aa1e21bf42ebd4456919744ae0f4f631e">RTC</a>.</p>
<p>Definition at line <a class="el" href="DS3232RTC_8cpp_source.html#l00225">225</a> of file <a class="el" href="DS3232RTC_8cpp_source.html">DS3232RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="af89e68c68f1c4b7e94286f800b5b2747"></a><!-- doxytag: member="DS3232RTC::readTime" ref="af89e68c68f1c4b7e94286f800b5b2747" args="(RTCTime *value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void DS3232RTC::readTime </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structRTCTime.html">RTCTime</a> *&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reads the current time from the realtime clock into <em>value</em>. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classDS3232RTC.html#ab0ca13a8b80da856b37fc53b84e27c78" title="Updates the time in the realtime clock to match value.">writeTime()</a>, <a class="el" href="classDS3232RTC.html#ab03358e3b5996e38d766e2f9f6ab62ca" title="Reads the current date from the realtime clock into value.">readDate()</a> </dd></dl>
<p>Reimplemented from <a class="el" href="classRTC.html#aaf0a5c1f32f210a49718d148620b5bec">RTC</a>.</p>
<p>Definition at line <a class="el" href="DS3232RTC_8cpp_source.html#l00205">205</a> of file <a class="el" href="DS3232RTC_8cpp_source.html">DS3232RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a8b0a65e0ac479aec8fad6ca3147dbe75"></a><!-- doxytag: member="DS3232RTC::writeAlarm" ref="a8b0a65e0ac479aec8fad6ca3147dbe75" args="(uint8_t alarmNum, const RTCAlarm *value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void DS3232RTC::writeAlarm </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>alarmNum</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="structRTCAlarm.html">RTCAlarm</a> *&#160;</td>
<td class="paramname"><em>value</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Updates the details of the alarm with index <em>alarmNum</em> from <em>value</em>. </p>
<p>The <em>alarmNum</em> parameter must be between 0 and <a class="el" href="classRTC.html#aee5ae8f600ee5296e65635c0d836fca3">ALARM_COUNT</a> - 1.</p>
<p>Alarm details are stored at the end of the realtime clock's non-volatile memory.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classDS3232RTC.html#a09c7073c687dcbbc423baf48074c7873" title="Reads the details of the alarm with index alarmNum into value.">readAlarm()</a>, alarmCount() </dd></dl>
<p>Reimplemented from <a class="el" href="classRTC.html#a0e96c91efd9e7a6340effdae3eadf17e">RTC</a>.</p>
<p>Definition at line <a class="el" href="DS3232RTC_8cpp_source.html#l00298">298</a> of file <a class="el" href="DS3232RTC_8cpp_source.html">DS3232RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a9acebf12c5cecdd6d84e0ff9ed41765a"></a><!-- doxytag: member="DS3232RTC::writeByte" ref="a9acebf12c5cecdd6d84e0ff9ed41765a" args="(uint8_t offset, uint8_t value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void DS3232RTC::writeByte </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>offset</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>value</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Writes <em>value</em> to <em>offset</em> within the realtime clock's non-volatile memory. </p>
<p>The <em>offset</em> parameter must be between 0 and <a class="el" href="classDS3232RTC.html#a1319fe936dcb7e9d6bdf200b77a94f8e" title="Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings...">byteCount()</a> - 1.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classDS3232RTC.html#a5ba83a3ef7d65d45c2f3241afdd8fef7" title="Reads the byte at offset within the realtime clock&#39;s non-volatile memory.">readByte()</a>, <a class="el" href="classDS3232RTC.html#a1319fe936dcb7e9d6bdf200b77a94f8e" title="Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings...">byteCount()</a> </dd></dl>
<p>Reimplemented from <a class="el" href="classRTC.html#a1cab6397ec04b1e2b3feea5b3cd1f749">RTC</a>.</p>
<p>Definition at line <a class="el" href="DS3232RTC_8cpp_source.html#l00348">348</a> of file <a class="el" href="DS3232RTC_8cpp_source.html">DS3232RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a31c004a90c724979d8267c31f2dbf5ed"></a><!-- doxytag: member="DS3232RTC::writeDate" ref="a31c004a90c724979d8267c31f2dbf5ed" args="(const RTCDate *value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void DS3232RTC::writeDate </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="structRTCDate.html">RTCDate</a> *&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Updates the date in the realtime clock to match <em>value</em>. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classDS3232RTC.html#ab03358e3b5996e38d766e2f9f6ab62ca" title="Reads the current date from the realtime clock into value.">readDate()</a>, <a class="el" href="classDS3232RTC.html#ab0ca13a8b80da856b37fc53b84e27c78" title="Updates the time in the realtime clock to match value.">writeTime()</a> </dd></dl>
<p>Reimplemented from <a class="el" href="classRTC.html#ae667600d05c8e7b06a93574dd068a4d7">RTC</a>.</p>
<p>Definition at line <a class="el" href="DS3232RTC_8cpp_source.html#l00264">264</a> of file <a class="el" href="DS3232RTC_8cpp_source.html">DS3232RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ab0ca13a8b80da856b37fc53b84e27c78"></a><!-- doxytag: member="DS3232RTC::writeTime" ref="ab0ca13a8b80da856b37fc53b84e27c78" args="(const RTCTime *value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void DS3232RTC::writeTime </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="structRTCTime.html">RTCTime</a> *&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Updates the time in the realtime clock to match <em>value</em>. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classDS3232RTC.html#af89e68c68f1c4b7e94286f800b5b2747" title="Reads the current time from the realtime clock into value.">readTime()</a>, <a class="el" href="classDS3232RTC.html#a31c004a90c724979d8267c31f2dbf5ed" title="Updates the date in the realtime clock to match value.">writeDate()</a> </dd></dl>
<p>Reimplemented from <a class="el" href="classRTC.html#a102e2ec15bf0273d8f7e9ce4b6dcc96e">RTC</a>.</p>
<p>Definition at line <a class="el" href="DS3232RTC_8cpp_source.html#l00250">250</a> of file <a class="el" href="DS3232RTC_8cpp_source.html">DS3232RTC.cpp</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="DS3232RTC_8h_source.html">DS3232RTC.h</a></li>
<li><a class="el" href="DS3232RTC_8cpp_source.html">DS3232RTC.cpp</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

BIN
classDS3232RTC.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

100
classField-members.html Normal file
View File

@ -0,0 +1,100 @@
<!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"/>
<title>ArduinoLibs: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">Field Member List</div> </div>
</div>
<div class="contents">
This is the complete list of members for <a class="el" href="classField.html">Field</a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="classField.html#a061bd1ed4d8b079df86465df8facd3b3">dispatch</a>(int event)</td><td><a class="el" href="classField.html">Field</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#aa032bbeacb405c56546cb56fbbee94f5">enterField</a>(bool reverse)</td><td><a class="el" href="classField.html">Field</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#ad6805c75ee1e62f8cd8bd550c4530c07">exitField</a>()</td><td><a class="el" href="classField.html">Field</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#ac4ea0d104376233c3f0bfc080ec8564e">Field</a>(const String &amp;label)</td><td><a class="el" href="classField.html">Field</a></td><td><code> [explicit]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#a7e2bdb203ddfd9219696f263c1731fe7">Field</a>(Form &amp;form, const String &amp;label)</td><td><a class="el" href="classField.html">Field</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#a27427319be1cc92db3128637d8884ee5">form</a>() const </td><td><a class="el" href="classField.html">Field</a></td><td><code> [inline]</code></td></tr>
<tr bgcolor="#f0f0f0"><td><b>Form</b> (defined in <a class="el" href="classField.html">Field</a>)</td><td><a class="el" href="classField.html">Field</a></td><td><code> [friend]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#a25d86a67b321e8c642edf75a10a35f72">isCurrent</a>() const </td><td><a class="el" href="classField.html">Field</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#aaa861ef917130c989a955bc75c683afe">label</a>() const </td><td><a class="el" href="classField.html">Field</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1">lcd</a>() const </td><td><a class="el" href="classField.html">Field</a></td><td><code> [inline, protected]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#ad4ea63599d780c35b296cf2840b69f7b">setLabel</a>(const String &amp;label)</td><td><a class="el" href="classField.html">Field</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#afc612378167be0e7f8a6f8395b3537bd">updateCursor</a>()</td><td><a class="el" href="classField.html">Field</a></td><td><code> [protected, virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#a45d6e6d09b8f8e46de62b40119d62c60">~Field</a>()</td><td><a class="el" href="classField.html">Field</a></td><td></td></tr>
</table></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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

367
classField.html Normal file
View File

@ -0,0 +1,367 @@
<!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"/>
<title>ArduinoLibs: Field Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#friends">Friends</a> </div>
<div class="headertitle">
<div class="title">Field Class Reference</div> </div>
</div>
<div class="contents">
<!-- doxytag: class="Field" -->
<p>Manages a single data input/output field within a <a class="el" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a>.
<a href="classField.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="Field_8h_source.html">Field.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for Field:</div>
<div class="dyncontent">
<div class="center">
<img src="classField.png" usemap="#Field_map" alt=""/>
<map id="Field_map" name="Field_map">
<area href="classBoolField.html" title="Field that manages the input of a boolean value." alt="BoolField" shape="rect" coords="0,56,66,80"/>
<area href="classIntField.html" title="Field that manages the input of an integer value." alt="IntField" shape="rect" coords="76,56,142,80"/>
<area href="classListField.html" title="Field that manages selection from a static list of items." alt="ListField" shape="rect" coords="152,56,218,80"/>
<area href="classTextField.html" title="Field that displays a read-only text value." alt="TextField" shape="rect" coords="228,56,294,80"/>
<area href="classTimeField.html" title="Field that manages the display and editing of a time value." alt="TimeField" shape="rect" coords="304,56,370,80"/>
</map>
</div></div>
<p><a href="classField-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classField.html#ac4ea0d104376233c3f0bfc080ec8564e">Field</a> (const String &amp;label)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new field with a specific <em>label</em>. <a href="#ac4ea0d104376233c3f0bfc080ec8564e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7e2bdb203ddfd9219696f263c1731fe7"></a><!-- doxytag: member="Field::Field" ref="a7e2bdb203ddfd9219696f263c1731fe7" args="(Form &amp;form, const String &amp;label)" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classField.html#a7e2bdb203ddfd9219696f263c1731fe7">Field</a> (<a class="el" href="classForm.html">Form</a> &amp;form, const String &amp;label)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new field with a specific <em>label</em> and attaches it to a <em>form</em>. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classField.html#a45d6e6d09b8f8e46de62b40119d62c60">~Field</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroys this field and removes it from its owning <a class="el" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a>. <a href="#a45d6e6d09b8f8e46de62b40119d62c60"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a27427319be1cc92db3128637d8884ee5"></a><!-- doxytag: member="Field::form" ref="a27427319be1cc92db3128637d8884ee5" args="() const " -->
<a class="el" href="classForm.html">Form</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classField.html#a27427319be1cc92db3128637d8884ee5">form</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the <a class="el" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> that owns this field; null if not associated with a <a class="el" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a>. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classField.html#a061bd1ed4d8b079df86465df8facd3b3">dispatch</a> (int event)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Dispatches <em>event</em> via this field. <a href="#a061bd1ed4d8b079df86465df8facd3b3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classField.html#aa032bbeacb405c56546cb56fbbee94f5">enterField</a> (bool reverse)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Enters the field due to form navigation. <a href="#aa032bbeacb405c56546cb56fbbee94f5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classField.html#ad6805c75ee1e62f8cd8bd550c4530c07">exitField</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Exits the field due to form navigation. <a href="#ad6805c75ee1e62f8cd8bd550c4530c07"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const String &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classField.html#aaa861ef917130c989a955bc75c683afe">label</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the label to display in the first line of this field. <a href="#aaa861ef917130c989a955bc75c683afe"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classField.html#ad4ea63599d780c35b296cf2840b69f7b">setLabel</a> (const String &amp;label)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the <em>label</em> to display in the first line of this field. <a href="#ad4ea63599d780c35b296cf2840b69f7b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classField.html#a25d86a67b321e8c642edf75a10a35f72">isCurrent</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if this field is the currently-displayed field in its owning form; false otherwise. <a href="#a25d86a67b321e8c642edf75a10a35f72"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5cf21bf958a71e51feac9e1bf9f599d1"></a><!-- doxytag: member="Field::lcd" ref="a5cf21bf958a71e51feac9e1bf9f599d1" args="() const " -->
LiquidCrystal *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1">lcd</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> that this field is being drawn on. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classField.html#afc612378167be0e7f8a6f8395b3537bd">updateCursor</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the cursor position after the label has been drawn by <a class="el" href="classField.html#ad4ea63599d780c35b296cf2840b69f7b" title="Sets the label to display in the first line of this field.">setLabel()</a>. <a href="#afc612378167be0e7f8a6f8395b3537bd"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="friends"></a>
Friends</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a75f6d4e61f8386b6958279e02d9e38ea"></a><!-- doxytag: member="Field::Form" ref="a75f6d4e61f8386b6958279e02d9e38ea" args="" -->
class&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classField.html#a75f6d4e61f8386b6958279e02d9e38ea">Form</a></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Manages a single data input/output field within a <a class="el" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a>. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a>, <a class="el" href="classBoolField.html" title="Field that manages the input of a boolean value.">BoolField</a>, <a class="el" href="classIntField.html" title="Field that manages the input of an integer value.">IntField</a>, <a class="el" href="classListField.html" title="Field that manages selection from a static list of items.">ListField</a>, <a class="el" href="classTextField.html" title="Field that displays a read-only text value.">TextField</a>, <a class="el" href="classTimeField.html" title="Field that manages the display and editing of a time value.">TimeField</a> </dd></dl>
<p>Definition at line <a class="el" href="Field_8h_source.html#l00028">28</a> of file <a class="el" href="Field_8h_source.html">Field.h</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ac4ea0d104376233c3f0bfc080ec8564e"></a><!-- doxytag: member="Field::Field" ref="ac4ea0d104376233c3f0bfc080ec8564e" args="(const String &amp;label)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Field::Field </td>
<td>(</td>
<td class="paramtype">const String &amp;&#160;</td>
<td class="paramname"><em>label</em></td><td>)</td>
<td><code> [explicit]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs a new field with a specific <em>label</em>. </p>
<p>The field is initially not associated with a <a class="el" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a>. The field can be added to a form later using <a class="el" href="classForm.html#a5cb056ace428e75e321610555bfecac7" title="Adds field to this form.">Form::addField()</a>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classForm.html#a5cb056ace428e75e321610555bfecac7" title="Adds field to this form.">Form::addField()</a> </dd></dl>
<p>Definition at line <a class="el" href="Field_8cpp_source.html#l00040">40</a> of file <a class="el" href="Field_8cpp_source.html">Field.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a45d6e6d09b8f8e46de62b40119d62c60"></a><!-- doxytag: member="Field::~Field" ref="a45d6e6d09b8f8e46de62b40119d62c60" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Field::~Field </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Destroys this field and removes it from its owning <a class="el" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a>. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classForm.html#a7abd717029f9b19ee7318470072cd697" title="Removes field from this form.">Form::removeField()</a> </dd></dl>
<p>Definition at line <a class="el" href="Field_8cpp_source.html#l00066">66</a> of file <a class="el" href="Field_8cpp_source.html">Field.cpp</a>.</p>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a061bd1ed4d8b079df86465df8facd3b3"></a><!-- doxytag: member="Field::dispatch" ref="a061bd1ed4d8b079df86465df8facd3b3" args="(int event)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int Field::dispatch </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>event</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Dispatches <em>event</em> via this field. </p>
<p>The <em>event</em> is usually obtained from <a class="el" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292" title="Gets the next button press, release, or idle event.">LCD::getButton()</a>.</p>
<p>Returns zero if the <em>event</em> has been handled and no further action is required.</p>
<p>Returns FORM_CHANGED if the <em>event</em> has changed the value of this field in a manner that may require the application to take further action based on the new field value.</p>
<p>Returns -1 if the <em>event</em> is not handled by this field, and should be handled by the <a class="el" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> itself (particularly for Left and Right buttons). The default implementation returns -1 for all events.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classForm.html#a89bd3850e87caa2ca7b2e946f923d0ee" title="Dispatches event to the currently active field using Field::dispatch().">Form::dispatch()</a>, <a class="el" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292" title="Gets the next button press, release, or idle event.">LCD::getButton()</a> </dd></dl>
<p>Reimplemented in <a class="el" href="classBoolField.html#af793bafc1193d79b495c2ede711bca57">BoolField</a>, <a class="el" href="classIntField.html#a01a17d5a89c76c42c4f0516984ce653f">IntField</a>, <a class="el" href="classListField.html#a5d752bd561cde735b175bcdfda55832a">ListField</a>, and <a class="el" href="classTimeField.html#a9b953d9abdbe960a3fa34938462832e5">TimeField</a>.</p>
<p>Definition at line <a class="el" href="Field_8cpp_source.html#l00096">96</a> of file <a class="el" href="Field_8cpp_source.html">Field.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aa032bbeacb405c56546cb56fbbee94f5"></a><!-- doxytag: member="Field::enterField" ref="aa032bbeacb405c56546cb56fbbee94f5" args="(bool reverse)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Field::enterField </td>
<td>(</td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>reverse</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Enters the field due to form navigation. </p>
<p>This function is typically called when the user presses Left and Right buttons to navigate to the field. If <em>reverse</em> is true, then navigation was due to the Left button being pressed.</p>
<p>This function can assume that the display has been cleared and the cursor is positioned at (0, 0).</p>
<p>The default implementation prints the <a class="el" href="classField.html#aaa861ef917130c989a955bc75c683afe" title="Returns the label to display in the first line of this field.">label()</a>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classField.html#ad6805c75ee1e62f8cd8bd550c4530c07" title="Exits the field due to form navigation.">exitField()</a> </dd></dl>
<p>Reimplemented in <a class="el" href="classBoolField.html#ab3f1e610b52caed7e41016f6ae3d7d09">BoolField</a>, <a class="el" href="classIntField.html#a51d9127b660e8dd7f87718acd230202a">IntField</a>, <a class="el" href="classListField.html#a191b79b460e45cf48e04b04eface2888">ListField</a>, <a class="el" href="classTextField.html#aa78f1354f9240b64fabd6f996e312f32">TextField</a>, and <a class="el" href="classTimeField.html#ae914d6b870283a334d2d669460f7646b">TimeField</a>.</p>
<p>Definition at line <a class="el" href="Field_8cpp_source.html#l00116">116</a> of file <a class="el" href="Field_8cpp_source.html">Field.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ad6805c75ee1e62f8cd8bd550c4530c07"></a><!-- doxytag: member="Field::exitField" ref="ad6805c75ee1e62f8cd8bd550c4530c07" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Field::exitField </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Exits the field due to form navigation. </p>
<p>This function is typically called when the user presses Left and Right buttons to navigate from the field.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classField.html#aa032bbeacb405c56546cb56fbbee94f5" title="Enters the field due to form navigation.">enterField()</a> </dd></dl>
<p>Reimplemented in <a class="el" href="classTimeField.html#a5a6b7db2e3fda7745e0ff9c3d8d9a541">TimeField</a>.</p>
<p>Definition at line <a class="el" href="Field_8cpp_source.html#l00129">129</a> of file <a class="el" href="Field_8cpp_source.html">Field.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a25d86a67b321e8c642edf75a10a35f72"></a><!-- doxytag: member="Field::isCurrent" ref="a25d86a67b321e8c642edf75a10a35f72" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool Field::isCurrent </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns true if this field is the currently-displayed field in its owning form; false otherwise. </p>
<p>This function should be called from property setters in subclasses to determine if the screen should be updated when a property is modified. </p>
<p>Definition at line <a class="el" href="Field_8cpp_source.html#l00169">169</a> of file <a class="el" href="Field_8cpp_source.html">Field.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aaa861ef917130c989a955bc75c683afe"></a><!-- doxytag: member="Field::label" ref="aaa861ef917130c989a955bc75c683afe" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const String &amp; Field::label </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the label to display in the first line of this field. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classField.html#ad4ea63599d780c35b296cf2840b69f7b" title="Sets the label to display in the first line of this field.">setLabel()</a> </dd></dl>
<p>Definition at line <a class="el" href="Field_8h_source.html#l00041">41</a> of file <a class="el" href="Field_8h_source.html">Field.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad4ea63599d780c35b296cf2840b69f7b"></a><!-- doxytag: member="Field::setLabel" ref="ad4ea63599d780c35b296cf2840b69f7b" args="(const String &amp;label)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Field::setLabel </td>
<td>(</td>
<td class="paramtype">const String &amp;&#160;</td>
<td class="paramname"><em>label</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the <em>label</em> to display in the first line of this field. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classField.html#aaa861ef917130c989a955bc75c683afe" title="Returns the label to display in the first line of this field.">label()</a> </dd></dl>
<p>Definition at line <a class="el" href="Field_8cpp_source.html#l00146">146</a> of file <a class="el" href="Field_8cpp_source.html">Field.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="afc612378167be0e7f8a6f8395b3537bd"></a><!-- doxytag: member="Field::updateCursor" ref="afc612378167be0e7f8a6f8395b3537bd" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Field::updateCursor </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [protected, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Updates the cursor position after the label has been drawn by <a class="el" href="classField.html#ad4ea63599d780c35b296cf2840b69f7b" title="Sets the label to display in the first line of this field.">setLabel()</a>. </p>
<p>The default implementation does nothing. Subclasses that use an <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> cursor may override this to ensure that the cursor position stays valid after the label is modified.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classField.html#ad4ea63599d780c35b296cf2840b69f7b" title="Sets the label to display in the first line of this field.">setLabel()</a> </dd></dl>
<p>Definition at line <a class="el" href="Field_8cpp_source.html#l00191">191</a> of file <a class="el" href="Field_8cpp_source.html">Field.cpp</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="Field_8h_source.html">Field.h</a></li>
<li><a class="el" href="Field_8cpp_source.html">Field.cpp</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

BIN
classField.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 655 B

102
classForm-members.html Normal file
View File

@ -0,0 +1,102 @@
<!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"/>
<title>ArduinoLibs: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">Form Member List</div> </div>
</div>
<div class="contents">
This is the complete list of members for <a class="el" href="classForm.html">Form</a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="classForm.html#a5cb056ace428e75e321610555bfecac7">addField</a>(Field *field)</td><td><a class="el" href="classForm.html">Form</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classForm.html#a85a219a73294cef1f89a2182b5c25bf8">currentField</a>() const </td><td><a class="el" href="classForm.html">Form</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classForm.html#aba75b59f68b31dd77dbbac9ab5c3124b">defaultField</a>()</td><td><a class="el" href="classForm.html">Form</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classForm.html#a89bd3850e87caa2ca7b2e946f923d0ee">dispatch</a>(int event)</td><td><a class="el" href="classForm.html">Form</a></td><td></td></tr>
<tr bgcolor="#f0f0f0"><td><b>Field</b> (defined in <a class="el" href="classForm.html">Form</a>)</td><td><a class="el" href="classForm.html">Form</a></td><td><code> [friend]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classForm.html#ad30836b22edde707a52d94090b716996">Form</a>(LiquidCrystal &amp;lcd)</td><td><a class="el" href="classForm.html">Form</a></td><td><code> [explicit]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classForm.html#a88b9146a3f68e837c5e831203096f9e9">hide</a>()</td><td><a class="el" href="classForm.html">Form</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classForm.html#a48fb77f93e77b28b0397b59e1e9bf789">isCurrent</a>(Field &amp;field) const </td><td><a class="el" href="classForm.html">Form</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classForm.html#a3101f288e3e5aa8307c57f35861ad587">isVisible</a>() const </td><td><a class="el" href="classForm.html">Form</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classForm.html#a788a186ea4a7ebd75283a948ca45f4d1">nextField</a>()</td><td><a class="el" href="classForm.html">Form</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classForm.html#acb080fe4f4631e9060e6efab8eaa0a90">prevField</a>()</td><td><a class="el" href="classForm.html">Form</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classForm.html#a7abd717029f9b19ee7318470072cd697">removeField</a>(Field *field)</td><td><a class="el" href="classForm.html">Form</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classForm.html#ae6004fedfa07191ffd47d7b12370b4e5">setCurrentField</a>(Field *field)</td><td><a class="el" href="classForm.html">Form</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classForm.html#a9e8d718ab55a8034c22c606ccfa90d65">show</a>()</td><td><a class="el" href="classForm.html">Form</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classForm.html#a9cda7cce41e81bfaca51e922d4f9b98f">~Form</a>()</td><td><a class="el" href="classForm.html">Form</a></td><td></td></tr>
</table></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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

447
classForm.html Normal file
View File

@ -0,0 +1,447 @@
<!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"/>
<title>ArduinoLibs: Form Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#friends">Friends</a> </div>
<div class="headertitle">
<div class="title">Form Class Reference</div> </div>
</div>
<div class="contents">
<!-- doxytag: class="Form" -->
<p>Manager for a form containing data input/output fields.
<a href="classForm.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="Form_8h_source.html">Form.h</a>&gt;</code></p>
<p><a href="classForm-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classForm.html#ad30836b22edde707a52d94090b716996">Form</a> (LiquidCrystal &amp;lcd)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new form and associates it with <em>lcd</em>. <a href="#ad30836b22edde707a52d94090b716996"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9cda7cce41e81bfaca51e922d4f9b98f"></a><!-- doxytag: member="Form::~Form" ref="a9cda7cce41e81bfaca51e922d4f9b98f" args="()" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classForm.html#a9cda7cce41e81bfaca51e922d4f9b98f">~Form</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Detaches all remaining fields and destroys this form. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classForm.html#a89bd3850e87caa2ca7b2e946f923d0ee">dispatch</a> (int event)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Dispatches <em>event</em> to the currently active field using <a class="el" href="classField.html#a061bd1ed4d8b079df86465df8facd3b3" title="Dispatches event via this field.">Field::dispatch()</a>. <a href="#a89bd3850e87caa2ca7b2e946f923d0ee"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classForm.html#a788a186ea4a7ebd75283a948ca45f4d1">nextField</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Changes to the next field in the "tab order". <a href="#a788a186ea4a7ebd75283a948ca45f4d1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classForm.html#acb080fe4f4631e9060e6efab8eaa0a90">prevField</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Changes to the previous field in the "tab order". <a href="#acb080fe4f4631e9060e6efab8eaa0a90"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classForm.html#aba75b59f68b31dd77dbbac9ab5c3124b">defaultField</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Changes to default field (i.e., the first field). <a href="#aba75b59f68b31dd77dbbac9ab5c3124b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classForm.html#a5cb056ace428e75e321610555bfecac7">addField</a> (<a class="el" href="classField.html">Field</a> *field)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds <em>field</em> to this form. <a href="#a5cb056ace428e75e321610555bfecac7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classForm.html#a7abd717029f9b19ee7318470072cd697">removeField</a> (<a class="el" href="classField.html">Field</a> *field)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes <em>field</em> from this form. <a href="#a7abd717029f9b19ee7318470072cd697"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classField.html">Field</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classForm.html#a85a219a73294cef1f89a2182b5c25bf8">currentField</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current field that is displayed on-screen. <a href="#a85a219a73294cef1f89a2182b5c25bf8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classForm.html#ae6004fedfa07191ffd47d7b12370b4e5">setCurrentField</a> (<a class="el" href="classField.html">Field</a> *field)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the current <em>field</em> that is displayed on-screen. <a href="#ae6004fedfa07191ffd47d7b12370b4e5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classForm.html#a48fb77f93e77b28b0397b59e1e9bf789">isCurrent</a> (<a class="el" href="classField.html">Field</a> &amp;field) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if <em>field</em> is currently displayed on-screen, false otherwise. <a href="#a48fb77f93e77b28b0397b59e1e9bf789"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classForm.html#a9e8d718ab55a8034c22c606ccfa90d65">show</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Shows the form, or does nothing if the form is already on-screen. <a href="#a9e8d718ab55a8034c22c606ccfa90d65"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classForm.html#a88b9146a3f68e837c5e831203096f9e9">hide</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Hides the form, or does nothing if the form is not on-screen. <a href="#a88b9146a3f68e837c5e831203096f9e9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classForm.html#a3101f288e3e5aa8307c57f35861ad587">isVisible</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the form is shown; false if the form is hidden. <a href="#a3101f288e3e5aa8307c57f35861ad587"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="friends"></a>
Friends</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaec47a26a3c11c1debd3ed922b69cbd2"></a><!-- doxytag: member="Form::Field" ref="aaec47a26a3c11c1debd3ed922b69cbd2" args="" -->
class&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classForm.html#aaec47a26a3c11c1debd3ed922b69cbd2">Field</a></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Manager for a form containing data input/output fields. </p>
<p>See the <a class="el" href="lcd_form.html">Form example</a> for more information on creating an application that uses forms and fields. </p>
<p>Definition at line <a class="el" href="Form_8h_source.html#l00032">32</a> of file <a class="el" href="Form_8h_source.html">Form.h</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ad30836b22edde707a52d94090b716996"></a><!-- doxytag: member="Form::Form" ref="ad30836b22edde707a52d94090b716996" args="(LiquidCrystal &amp;lcd)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Form::Form </td>
<td>(</td>
<td class="paramtype">LiquidCrystal &amp;&#160;</td>
<td class="paramname"><em>lcd</em></td><td>)</td>
<td><code> [explicit]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs a new form and associates it with <em>lcd</em>. </p>
<p>This constructor is typically followed by calls to construct <a class="el" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> values for each of the fields on the form. For example:</p>
<div class="fragment"><pre class="fragment"> <a class="code" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> mainForm(lcd);
<a class="code" href="classTextField.html" title="Field that displays a read-only text value.">TextField</a> welcomeField(mainForm, <span class="stringliteral">&quot;Form example&quot;</span>, <span class="stringliteral">&quot;v1.0&quot;</span>);
</pre></div><div class="image">
<img src="FormText.png" alt="FormText.png"/>
</div>
<p>Definition at line <a class="el" href="Form_8cpp_source.html#l00047">47</a> of file <a class="el" href="Form_8cpp_source.html">Form.cpp</a>.</p>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a5cb056ace428e75e321610555bfecac7"></a><!-- doxytag: member="Form::addField" ref="a5cb056ace428e75e321610555bfecac7" args="(Field *field)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Form::addField </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classField.html">Field</a> *&#160;</td>
<td class="paramname"><em>field</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Adds <em>field</em> to this form. </p>
<p>Usually this function is not required because the field's constructor will add the field to the form automatically.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classForm.html#a7abd717029f9b19ee7318470072cd697" title="Removes field from this form.">removeField()</a> </dd></dl>
<p>Definition at line <a class="el" href="Form_8cpp_source.html#l00165">165</a> of file <a class="el" href="Form_8cpp_source.html">Form.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a85a219a73294cef1f89a2182b5c25bf8"></a><!-- doxytag: member="Form::currentField" ref="a85a219a73294cef1f89a2182b5c25bf8" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classField.html">Field</a> * Form::currentField </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the current field that is displayed on-screen. </p>
<p>Returns null if the form has no fields, or <a class="el" href="classForm.html#ae6004fedfa07191ffd47d7b12370b4e5" title="Sets the current field that is displayed on-screen.">setCurrentField()</a> explicitly set the current field to null.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classForm.html#ae6004fedfa07191ffd47d7b12370b4e5" title="Sets the current field that is displayed on-screen.">setCurrentField()</a>, <a class="el" href="classForm.html#a48fb77f93e77b28b0397b59e1e9bf789" title="Returns true if field is currently displayed on-screen, false otherwise.">isCurrent()</a> </dd></dl>
<p>Definition at line <a class="el" href="Form_8h_source.html#l00046">46</a> of file <a class="el" href="Form_8h_source.html">Form.h</a>.</p>
</div>
</div>
<a class="anchor" id="aba75b59f68b31dd77dbbac9ab5c3124b"></a><!-- doxytag: member="Form::defaultField" ref="aba75b59f68b31dd77dbbac9ab5c3124b" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Form::defaultField </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Changes to default field (i.e., the first field). </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classForm.html#a788a186ea4a7ebd75283a948ca45f4d1" title="Changes to the next field in the &quot;tab order&quot;.">nextField()</a>, <a class="el" href="classForm.html#acb080fe4f4631e9060e6efab8eaa0a90" title="Changes to the previous field in the &quot;tab order&quot;.">prevField()</a>, <a class="el" href="classForm.html#a85a219a73294cef1f89a2182b5c25bf8" title="Returns the current field that is displayed on-screen.">currentField()</a> </dd></dl>
<p>Definition at line <a class="el" href="Form_8cpp_source.html#l00152">152</a> of file <a class="el" href="Form_8cpp_source.html">Form.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a89bd3850e87caa2ca7b2e946f923d0ee"></a><!-- doxytag: member="Form::dispatch" ref="a89bd3850e87caa2ca7b2e946f923d0ee" args="(int event)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int Form::dispatch </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>event</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Dispatches <em>event</em> to the currently active field using <a class="el" href="classField.html#a061bd1ed4d8b079df86465df8facd3b3" title="Dispatches event via this field.">Field::dispatch()</a>. </p>
<p>The <em>event</em> is usually obtained from <a class="el" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292" title="Gets the next button press, release, or idle event.">LCD::getButton()</a>.</p>
<p>Returns zero if the <em>event</em> has been handled and no further action is required.</p>
<p>Returns FORM_CHANGED if one of the fields on the form has changed value due to the <em>event</em>, perhaps requiring the application to take further action based on the new field value. Use <a class="el" href="classForm.html#a85a219a73294cef1f89a2182b5c25bf8" title="Returns the current field that is displayed on-screen.">currentField()</a> or <a class="el" href="classForm.html#a48fb77f93e77b28b0397b59e1e9bf789" title="Returns true if field is currently displayed on-screen, false otherwise.">isCurrent()</a> to determine which field has changed.</p>
<div class="fragment"><pre class="fragment"> <span class="keywordtype">int</span> <span class="keyword">event</span> = lcd.<a class="code" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292" title="Gets the next button press, release, or idle event.">getButton</a>();
<span class="keywordflow">if</span> (mainForm.dispatch(event) == FORM_CHANGED) {
<span class="keywordflow">if</span> (mainForm.isCurrent(volumeField)) {
<span class="comment">// Adjust the volume to match the field.</span>
setVolume(volumeField.value());
}
}
</pre></div><p>This function handles the Left and Right buttons to navigate between fields.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classField.html#a061bd1ed4d8b079df86465df8facd3b3" title="Dispatches event via this field.">Field::dispatch()</a>, <a class="el" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292" title="Gets the next button press, release, or idle event.">LCD::getButton()</a>, <a class="el" href="classForm.html#a85a219a73294cef1f89a2182b5c25bf8" title="Returns the current field that is displayed on-screen.">currentField()</a>, <a class="el" href="classForm.html#a48fb77f93e77b28b0397b59e1e9bf789" title="Returns true if field is currently displayed on-screen, false otherwise.">isCurrent()</a> </dd></dl>
<p>Definition at line <a class="el" href="Form_8cpp_source.html#l00099">99</a> of file <a class="el" href="Form_8cpp_source.html">Form.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a88b9146a3f68e837c5e831203096f9e9"></a><!-- doxytag: member="Form::hide" ref="a88b9146a3f68e837c5e831203096f9e9" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Form::hide </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Hides the form, or does nothing if the form is not on-screen. </p>
<p>The screen will be cleared to remove the contents of the current field.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classForm.html#a9e8d718ab55a8034c22c606ccfa90d65" title="Shows the form, or does nothing if the form is already on-screen.">show()</a>, <a class="el" href="classForm.html#a3101f288e3e5aa8307c57f35861ad587" title="Returns true if the form is shown; false if the form is hidden.">isVisible()</a> </dd></dl>
<p>Definition at line <a class="el" href="Form_8cpp_source.html#l00293">293</a> of file <a class="el" href="Form_8cpp_source.html">Form.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a48fb77f93e77b28b0397b59e1e9bf789"></a><!-- doxytag: member="Form::isCurrent" ref="a48fb77f93e77b28b0397b59e1e9bf789" args="(Field &amp;field) const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool Form::isCurrent </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classField.html">Field</a> &amp;&#160;</td>
<td class="paramname"><em>field</em></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns true if <em>field</em> is currently displayed on-screen, false otherwise. </p>
<p>This function is typically called after <a class="el" href="classForm.html#a89bd3850e87caa2ca7b2e946f923d0ee" title="Dispatches event to the currently active field using Field::dispatch().">dispatch()</a> returns FORM_CHANGED to determine which field has changed.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classForm.html#a85a219a73294cef1f89a2182b5c25bf8" title="Returns the current field that is displayed on-screen.">currentField()</a>, <a class="el" href="classForm.html#ae6004fedfa07191ffd47d7b12370b4e5" title="Sets the current field that is displayed on-screen.">setCurrentField()</a> </dd></dl>
<p>Definition at line <a class="el" href="Form_8h_source.html#l00049">49</a> of file <a class="el" href="Form_8h_source.html">Form.h</a>.</p>
</div>
</div>
<a class="anchor" id="a3101f288e3e5aa8307c57f35861ad587"></a><!-- doxytag: member="Form::isVisible" ref="a3101f288e3e5aa8307c57f35861ad587" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool Form::isVisible </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns true if the form is shown; false if the form is hidden. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classForm.html#a9e8d718ab55a8034c22c606ccfa90d65" title="Shows the form, or does nothing if the form is already on-screen.">show()</a>, <a class="el" href="classForm.html#a88b9146a3f68e837c5e831203096f9e9" title="Hides the form, or does nothing if the form is not on-screen.">hide()</a> </dd></dl>
<p>Definition at line <a class="el" href="Form_8h_source.html#l00053">53</a> of file <a class="el" href="Form_8h_source.html">Form.h</a>.</p>
</div>
</div>
<a class="anchor" id="a788a186ea4a7ebd75283a948ca45f4d1"></a><!-- doxytag: member="Form::nextField" ref="a788a186ea4a7ebd75283a948ca45f4d1" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Form::nextField </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Changes to the next field in the "tab order". </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classForm.html#acb080fe4f4631e9060e6efab8eaa0a90" title="Changes to the previous field in the &quot;tab order&quot;.">prevField()</a>, <a class="el" href="classForm.html#aba75b59f68b31dd77dbbac9ab5c3124b" title="Changes to default field (i.e., the first field).">defaultField()</a>, <a class="el" href="classForm.html#a85a219a73294cef1f89a2182b5c25bf8" title="Returns the current field that is displayed on-screen.">currentField()</a> </dd></dl>
<p>Definition at line <a class="el" href="Form_8cpp_source.html#l00118">118</a> of file <a class="el" href="Form_8cpp_source.html">Form.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="acb080fe4f4631e9060e6efab8eaa0a90"></a><!-- doxytag: member="Form::prevField" ref="acb080fe4f4631e9060e6efab8eaa0a90" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Form::prevField </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Changes to the previous field in the "tab order". </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classForm.html#a788a186ea4a7ebd75283a948ca45f4d1" title="Changes to the next field in the &quot;tab order&quot;.">nextField()</a>, <a class="el" href="classForm.html#aba75b59f68b31dd77dbbac9ab5c3124b" title="Changes to default field (i.e., the first field).">defaultField()</a>, <a class="el" href="classForm.html#a85a219a73294cef1f89a2182b5c25bf8" title="Returns the current field that is displayed on-screen.">currentField()</a> </dd></dl>
<p>Definition at line <a class="el" href="Form_8cpp_source.html#l00135">135</a> of file <a class="el" href="Form_8cpp_source.html">Form.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a7abd717029f9b19ee7318470072cd697"></a><!-- doxytag: member="Form::removeField" ref="a7abd717029f9b19ee7318470072cd697" args="(Field *field)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Form::removeField </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classField.html">Field</a> *&#160;</td>
<td class="paramname"><em>field</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Removes <em>field</em> from this form. </p>
<p>If <em>field</em> is the current field on-screen, then either the next or previous field will be made current.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classForm.html#a5cb056ace428e75e321610555bfecac7" title="Adds field to this form.">addField()</a> </dd></dl>
<p>Definition at line <a class="el" href="Form_8cpp_source.html#l00187">187</a> of file <a class="el" href="Form_8cpp_source.html">Form.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ae6004fedfa07191ffd47d7b12370b4e5"></a><!-- doxytag: member="Form::setCurrentField" ref="ae6004fedfa07191ffd47d7b12370b4e5" args="(Field *field)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Form::setCurrentField </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classField.html">Field</a> *&#160;</td>
<td class="paramname"><em>field</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the current <em>field</em> that is displayed on-screen. </p>
<p>Use this function to programmatically force the form to display a specific field on-screen.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classForm.html#a85a219a73294cef1f89a2182b5c25bf8" title="Returns the current field that is displayed on-screen.">currentField()</a>, <a class="el" href="classForm.html#a48fb77f93e77b28b0397b59e1e9bf789" title="Returns true if field is currently displayed on-screen, false otherwise.">isCurrent()</a> </dd></dl>
<p>Definition at line <a class="el" href="Form_8cpp_source.html#l00230">230</a> of file <a class="el" href="Form_8cpp_source.html">Form.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a9e8d718ab55a8034c22c606ccfa90d65"></a><!-- doxytag: member="Form::show" ref="a9e8d718ab55a8034c22c606ccfa90d65" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Form::show </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Shows the form, or does nothing if the form is already on-screen. </p>
<p>When the form is shown, the screen will be cleared and the <a class="el" href="classForm.html#a85a219a73294cef1f89a2182b5c25bf8" title="Returns the current field that is displayed on-screen.">currentField()</a> will be drawn.</p>
<p>If the form was previously hidden, then the field that was previously current will be shown again. Call <a class="el" href="classForm.html#aba75b59f68b31dd77dbbac9ab5c3124b" title="Changes to default field (i.e., the first field).">defaultField()</a> before <a class="el" href="classForm.html#a9e8d718ab55a8034c22c606ccfa90d65" title="Shows the form, or does nothing if the form is already on-screen.">show()</a> to reset the form to show the first field instead.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classForm.html#a88b9146a3f68e837c5e831203096f9e9" title="Hides the form, or does nothing if the form is not on-screen.">hide()</a>, <a class="el" href="classForm.html#a3101f288e3e5aa8307c57f35861ad587" title="Returns true if the form is shown; false if the form is hidden.">isVisible()</a>, <a class="el" href="classForm.html#aba75b59f68b31dd77dbbac9ab5c3124b" title="Changes to default field (i.e., the first field).">defaultField()</a> </dd></dl>
<p>Definition at line <a class="el" href="Form_8cpp_source.html#l00274">274</a> of file <a class="el" href="Form_8cpp_source.html">Form.cpp</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="Form_8h_source.html">Form.h</a></li>
<li><a class="el" href="Form_8cpp_source.html">Form.cpp</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

View File

@ -0,0 +1,94 @@
<!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"/>
<title>ArduinoLibs: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">I2CMaster Member List</div> </div>
</div>
<div class="contents">
This is the complete list of members for <a class="el" href="classI2CMaster.html">I2CMaster</a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="classI2CMaster.html#a6458fa99cfd9e6270ae6dff993955833">available</a>()=0</td><td><a class="el" href="classI2CMaster.html">I2CMaster</a></td><td><code> [pure virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classI2CMaster.html#ab29f63551ddeb032a91505d1c0b8ac41">endWrite</a>()=0</td><td><a class="el" href="classI2CMaster.html">I2CMaster</a></td><td><code> [pure virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classI2CMaster.html#a3cd0cea8169ac4e6dd6f39fd6cfb1926">maxTransferSize</a>() const =0</td><td><a class="el" href="classI2CMaster.html">I2CMaster</a></td><td><code> [pure virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd">read</a>()=0</td><td><a class="el" href="classI2CMaster.html">I2CMaster</a></td><td><code> [pure virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classI2CMaster.html#a4e5f1a1a4c2242699be5a35fc4872fde">startRead</a>(unsigned int address, unsigned int count)=0</td><td><a class="el" href="classI2CMaster.html">I2CMaster</a></td><td><code> [pure virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35">startWrite</a>(unsigned int address)</td><td><a class="el" href="classI2CMaster.html">I2CMaster</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960">write</a>(uint8_t value)=0</td><td><a class="el" href="classI2CMaster.html">I2CMaster</a></td><td><code> [pure virtual]</code></td></tr>
</table></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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

276
classI2CMaster.html Normal file
View File

@ -0,0 +1,276 @@
<!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"/>
<title>ArduinoLibs: I2CMaster Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> </div>
<div class="headertitle">
<div class="title">I2CMaster Class Reference</div> </div>
</div>
<div class="contents">
<!-- doxytag: class="I2CMaster" -->
<p>Abstract base class for I2C master implementations.
<a href="classI2CMaster.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="I2CMaster_8h_source.html">I2CMaster.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for I2CMaster:</div>
<div class="dyncontent">
<div class="center">
<img src="classI2CMaster.png" usemap="#I2CMaster_map" alt=""/>
<map id="I2CMaster_map" name="I2CMaster_map">
<area href="classSoftI2C.html" title="Bit-banged implementation of an I2C master." alt="SoftI2C" shape="rect" coords="0,56,70,80"/>
</map>
</div></div>
<p><a href="classI2CMaster-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3cd0cea8169ac4e6dd6f39fd6cfb1926"></a><!-- doxytag: member="I2CMaster::maxTransferSize" ref="a3cd0cea8169ac4e6dd6f39fd6cfb1926" args="() const =0" -->
virtual unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classI2CMaster.html#a3cd0cea8169ac4e6dd6f39fd6cfb1926">maxTransferSize</a> () const =0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the maximum number of bytes that can be read or written in a single request by this bus master. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35">startWrite</a> (unsigned int address)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Starts a write operation by sending a start condition and the I2C control byte. <a href="#a01960fc821cb25e4c88c26d2c6107e35"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960">write</a> (uint8_t value)=0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes a single byte <em>value</em> on the I2C bus. <a href="#a0bf6b84cb1e2b3a37a4a0260d0b6f960"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classI2CMaster.html#ab29f63551ddeb032a91505d1c0b8ac41">endWrite</a> ()=0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Ends the current write operation. <a href="#ab29f63551ddeb032a91505d1c0b8ac41"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classI2CMaster.html#a4e5f1a1a4c2242699be5a35fc4872fde">startRead</a> (unsigned int address, unsigned int count)=0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Starts a read operation for <em>count</em> bytes by sending the start condition and the I2C control byte. <a href="#a4e5f1a1a4c2242699be5a35fc4872fde"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classI2CMaster.html#a6458fa99cfd9e6270ae6dff993955833">available</a> ()=0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of bytes that are still available for reading. <a href="#a6458fa99cfd9e6270ae6dff993955833"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd">read</a> ()=0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads a single byte from the I2C bus. <a href="#a49eeebb57f6bc06de39973fe836369cd"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Abstract base class for I2C master implementations. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classSoftI2C.html" title="Bit-banged implementation of an I2C master.">SoftI2C</a> </dd></dl>
<p>Definition at line <a class="el" href="I2CMaster_8h_source.html#l00028">28</a> of file <a class="el" href="I2CMaster_8h_source.html">I2CMaster.h</a>.</p>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a6458fa99cfd9e6270ae6dff993955833"></a><!-- doxytag: member="I2CMaster::available" ref="a6458fa99cfd9e6270ae6dff993955833" args="()=0" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned int I2CMaster::available </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [pure virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the number of bytes that are still available for reading. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classI2CMaster.html#a4e5f1a1a4c2242699be5a35fc4872fde" title="Starts a read operation for count bytes by sending the start condition and the I2C control byte...">startRead()</a>, <a class="el" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd" title="Reads a single byte from the I2C bus.">read()</a> </dd></dl>
<p>Implemented in <a class="el" href="classSoftI2C.html#a849af91018caedbb82e83f02c543305e">SoftI2C</a>.</p>
</div>
</div>
<a class="anchor" id="ab29f63551ddeb032a91505d1c0b8ac41"></a><!-- doxytag: member="I2CMaster::endWrite" ref="ab29f63551ddeb032a91505d1c0b8ac41" args="()=0" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool I2CMaster::endWrite </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [pure virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Ends the current write operation. </p>
<p>Returns true if the write operation was acknowledged; false otherwise.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite()</a>, <a class="el" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write()</a> </dd></dl>
<p>Implemented in <a class="el" href="classSoftI2C.html#aa12ae82813598b2e9ea70463c23c5bf3">SoftI2C</a>.</p>
</div>
</div>
<a class="anchor" id="a49eeebb57f6bc06de39973fe836369cd"></a><!-- doxytag: member="I2CMaster::read" ref="a49eeebb57f6bc06de39973fe836369cd" args="()=0" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint8_t I2CMaster::read </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [pure virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reads a single byte from the I2C bus. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classI2CMaster.html#a4e5f1a1a4c2242699be5a35fc4872fde" title="Starts a read operation for count bytes by sending the start condition and the I2C control byte...">startRead()</a>, <a class="el" href="classI2CMaster.html#a6458fa99cfd9e6270ae6dff993955833" title="Returns the number of bytes that are still available for reading.">available()</a> </dd></dl>
<p>Implemented in <a class="el" href="classSoftI2C.html#a330dbba5b726fa161a6b01a9ca49e1bc">SoftI2C</a>.</p>
</div>
</div>
<a class="anchor" id="a4e5f1a1a4c2242699be5a35fc4872fde"></a><!-- doxytag: member="I2CMaster::startRead" ref="a4e5f1a1a4c2242699be5a35fc4872fde" args="(unsigned int address, unsigned int count)=0" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool I2CMaster::startRead </td>
<td>(</td>
<td class="paramtype">unsigned int&#160;</td>
<td class="paramname"><em>address</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int&#160;</td>
<td class="paramname"><em>count</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [pure virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Starts a read operation for <em>count</em> bytes by sending the start condition and the I2C control byte. </p>
<p>The <em>address</em> must be the 7-bit or 10-bit address of the I2C slave on the bus.</p>
<p>Returns true if the read request was acknowledged by the I2C slave or false otherwise. If true, this function should be followed by <em>count</em> calls to <a class="el" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd" title="Reads a single byte from the I2C bus.">read()</a> to fetch the bytes.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classI2CMaster.html#a6458fa99cfd9e6270ae6dff993955833" title="Returns the number of bytes that are still available for reading.">available()</a>, <a class="el" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd" title="Reads a single byte from the I2C bus.">read()</a>, <a class="el" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite()</a> </dd></dl>
<p>Implemented in <a class="el" href="classSoftI2C.html#aa0dafc067cfa374af75e060dca647ec3">SoftI2C</a>.</p>
</div>
</div>
<a class="anchor" id="a01960fc821cb25e4c88c26d2c6107e35"></a><!-- doxytag: member="I2CMaster::startWrite" ref="a01960fc821cb25e4c88c26d2c6107e35" args="(unsigned int address)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void I2CMaster::startWrite </td>
<td>(</td>
<td class="paramtype">unsigned int&#160;</td>
<td class="paramname"><em>address</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Starts a write operation by sending a start condition and the I2C control byte. </p>
<p>The <em>address</em> must be the 7-bit or 10-bit address of the I2C slave on the bus.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960" title="Writes a single byte value on the I2C bus.">write()</a>, <a class="el" href="classI2CMaster.html#ab29f63551ddeb032a91505d1c0b8ac41" title="Ends the current write operation.">endWrite()</a>, <a class="el" href="classI2CMaster.html#a4e5f1a1a4c2242699be5a35fc4872fde" title="Starts a read operation for count bytes by sending the start condition and the I2C control byte...">startRead()</a> </dd></dl>
<p>Reimplemented in <a class="el" href="classSoftI2C.html#aa8a3219f4e6ff52306cc3c219f37d8f9">SoftI2C</a>.</p>
</div>
</div>
<a class="anchor" id="a0bf6b84cb1e2b3a37a4a0260d0b6f960"></a><!-- doxytag: member="I2CMaster::write" ref="a0bf6b84cb1e2b3a37a4a0260d0b6f960" args="(uint8_t value)=0" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void I2CMaster::write </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td><code> [pure virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Writes a single byte <em>value</em> on the I2C bus. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite()</a>, <a class="el" href="classI2CMaster.html#ab29f63551ddeb032a91505d1c0b8ac41" title="Ends the current write operation.">endWrite()</a> </dd></dl>
<p>Implemented in <a class="el" href="classSoftI2C.html#ab46f0b6363c9cfe6fb3ab907956d5d73">SoftI2C</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="I2CMaster_8h_source.html">I2CMaster.h</a></li>
<li><a class="el" href="I2CMaster_8cpp_source.html">I2CMaster.cpp</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

BIN
classI2CMaster.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 B

112
classIntField-members.html Normal file
View File

@ -0,0 +1,112 @@
<!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"/>
<title>ArduinoLibs: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">IntField Member List</div> </div>
</div>
<div class="contents">
This is the complete list of members for <a class="el" href="classIntField.html">IntField</a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="classIntField.html#a01a17d5a89c76c42c4f0516984ce653f">dispatch</a>(int event)</td><td><a class="el" href="classIntField.html">IntField</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classIntField.html#a51d9127b660e8dd7f87718acd230202a">enterField</a>(bool reverse)</td><td><a class="el" href="classIntField.html">IntField</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#ad6805c75ee1e62f8cd8bd550c4530c07">exitField</a>()</td><td><a class="el" href="classField.html">Field</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#ac4ea0d104376233c3f0bfc080ec8564e">Field</a>(const String &amp;label)</td><td><a class="el" href="classField.html">Field</a></td><td><code> [explicit]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#a7e2bdb203ddfd9219696f263c1731fe7">Field</a>(Form &amp;form, const String &amp;label)</td><td><a class="el" href="classField.html">Field</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#a27427319be1cc92db3128637d8884ee5">form</a>() const </td><td><a class="el" href="classField.html">Field</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classIntField.html#a9df274c4100ed37d2d78738f09fc53b6">IntField</a>(const String &amp;label)</td><td><a class="el" href="classIntField.html">IntField</a></td><td><code> [explicit]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classIntField.html#a10c9c958bcde276698f1f1f9bff949dd">IntField</a>(Form &amp;form, const String &amp;label, int minValue, int maxValue, int stepValue, int value)</td><td><a class="el" href="classIntField.html">IntField</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classIntField.html#a2b99fa19be6a0ed01ddc4939352b372e">IntField</a>(Form &amp;form, const String &amp;label, int minValue, int maxValue, int stepValue, int value, const String &amp;suffix)</td><td><a class="el" href="classIntField.html">IntField</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#a25d86a67b321e8c642edf75a10a35f72">isCurrent</a>() const </td><td><a class="el" href="classField.html">Field</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#aaa861ef917130c989a955bc75c683afe">label</a>() const </td><td><a class="el" href="classField.html">Field</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1">lcd</a>() const </td><td><a class="el" href="classField.html">Field</a></td><td><code> [inline, protected]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classIntField.html#aaa0adcb0d16e822e5f176be5cb9ca8ad">maxValue</a>() const </td><td><a class="el" href="classIntField.html">IntField</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classIntField.html#af3dab3f2b46d29136d7a93ce46b0b8fb">minValue</a>() const </td><td><a class="el" href="classIntField.html">IntField</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#ad4ea63599d780c35b296cf2840b69f7b">setLabel</a>(const String &amp;label)</td><td><a class="el" href="classField.html">Field</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classIntField.html#a36cbd7c24480cc3fcf0c7634d5e22bf1">setMaxValue</a>(int value)</td><td><a class="el" href="classIntField.html">IntField</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classIntField.html#afffe7be6721a043cec7a5a85c19e0ada">setMinValue</a>(int value)</td><td><a class="el" href="classIntField.html">IntField</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classIntField.html#a8fb6e207bd906062bb788e19dbe58bcb">setStepValue</a>(int value)</td><td><a class="el" href="classIntField.html">IntField</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classIntField.html#a9324bba994389f3a4563d9c18bd2f1cd">setSuffix</a>(const String &amp;suffix)</td><td><a class="el" href="classIntField.html">IntField</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classIntField.html#aed421e2c52946f2c7643534b4f6f13f7">setValue</a>(int value)</td><td><a class="el" href="classIntField.html">IntField</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classIntField.html#a49025ee3473fe066a6a6c546af98bfbd">stepValue</a>() const </td><td><a class="el" href="classIntField.html">IntField</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classIntField.html#a1a1de6a1836dfdb820c92b7f188a1b05">suffix</a>() const </td><td><a class="el" href="classIntField.html">IntField</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#afc612378167be0e7f8a6f8395b3537bd">updateCursor</a>()</td><td><a class="el" href="classField.html">Field</a></td><td><code> [protected, virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classIntField.html#a2fb650827ce8cb4662253bb6c32acb52">value</a>() const </td><td><a class="el" href="classIntField.html">IntField</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#a45d6e6d09b8f8e46de62b40119d62c60">~Field</a>()</td><td><a class="el" href="classField.html">Field</a></td><td></td></tr>
</table></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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

517
classIntField.html Normal file
View File

@ -0,0 +1,517 @@
<!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"/>
<title>ArduinoLibs: IntField Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> </div>
<div class="headertitle">
<div class="title">IntField Class Reference</div> </div>
</div>
<div class="contents">
<!-- doxytag: class="IntField" --><!-- doxytag: inherits="Field" -->
<p><a class="el" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> that manages the input of an integer value.
<a href="classIntField.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="IntField_8h_source.html">IntField.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for IntField:</div>
<div class="dyncontent">
<div class="center">
<img src="classIntField.png" usemap="#IntField_map" alt=""/>
<map id="IntField_map" name="IntField_map">
<area href="classField.html" title="Manages a single data input/output field within a Form." alt="Field" shape="rect" coords="0,0,53,24"/>
</map>
</div></div>
<p><a href="classIntField-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIntField.html#a9df274c4100ed37d2d78738f09fc53b6">IntField</a> (const String &amp;label)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new integer field with a specific <em>label</em>. <a href="#a9df274c4100ed37d2d78738f09fc53b6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIntField.html#a10c9c958bcde276698f1f1f9bff949dd">IntField</a> (<a class="el" href="classForm.html">Form</a> &amp;form, const String &amp;label, int minValue, int maxValue, int stepValue, int value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new integer field with a specific <em>label</em>, <em>minValue</em>, <em>maxValue</em>, <em>stepValue</em>, and <em>value</em>, and attaches it to a <em>form</em>. <a href="#a10c9c958bcde276698f1f1f9bff949dd"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2b99fa19be6a0ed01ddc4939352b372e"></a><!-- doxytag: member="IntField::IntField" ref="a2b99fa19be6a0ed01ddc4939352b372e" args="(Form &amp;form, const String &amp;label, int minValue, int maxValue, int stepValue, int value, const String &amp;suffix)" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIntField.html#a2b99fa19be6a0ed01ddc4939352b372e">IntField</a> (<a class="el" href="classForm.html">Form</a> &amp;form, const String &amp;label, int minValue, int maxValue, int stepValue, int value, const String &amp;suffix)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new integer field with a specific <em>label</em>, <em>minValue</em>, <em>maxValue</em>, <em>stepValue</em>, <em>value</em>, and <em>suffix</em> and attaches it to a <em>form</em>. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIntField.html#a01a17d5a89c76c42c4f0516984ce653f">dispatch</a> (int event)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Dispatches <em>event</em> via this field. <a href="#a01a17d5a89c76c42c4f0516984ce653f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIntField.html#a51d9127b660e8dd7f87718acd230202a">enterField</a> (bool reverse)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Enters the field due to form navigation. <a href="#a51d9127b660e8dd7f87718acd230202a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIntField.html#af3dab3f2b46d29136d7a93ce46b0b8fb">minValue</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the minimum value for the input field. <a href="#af3dab3f2b46d29136d7a93ce46b0b8fb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIntField.html#afffe7be6721a043cec7a5a85c19e0ada">setMinValue</a> (int value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the minimum <em>value</em> for the input field. <a href="#afffe7be6721a043cec7a5a85c19e0ada"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIntField.html#aaa0adcb0d16e822e5f176be5cb9ca8ad">maxValue</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the maximum value for the input field. <a href="#aaa0adcb0d16e822e5f176be5cb9ca8ad"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIntField.html#a36cbd7c24480cc3fcf0c7634d5e22bf1">setMaxValue</a> (int value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the maximum <em>value</em> for the input field. <a href="#a36cbd7c24480cc3fcf0c7634d5e22bf1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIntField.html#a49025ee3473fe066a6a6c546af98bfbd">stepValue</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the step value to use when increasing or decreasing the <a class="el" href="classIntField.html#a2fb650827ce8cb4662253bb6c32acb52" title="Returns the current value of this field.">value()</a> due to Up and Down button presses. <a href="#a49025ee3473fe066a6a6c546af98bfbd"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIntField.html#a8fb6e207bd906062bb788e19dbe58bcb">setStepValue</a> (int value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the step value <em>value</em> to use when increasing or decreasing the <a class="el" href="classIntField.html#a2fb650827ce8cb4662253bb6c32acb52" title="Returns the current value of this field.">value()</a> due to Up and Down button presses. <a href="#a8fb6e207bd906062bb788e19dbe58bcb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIntField.html#a2fb650827ce8cb4662253bb6c32acb52">value</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current value of this field. <a href="#a2fb650827ce8cb4662253bb6c32acb52"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIntField.html#aed421e2c52946f2c7643534b4f6f13f7">setValue</a> (int value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the current <em>value</em> of this field. <a href="#aed421e2c52946f2c7643534b4f6f13f7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const String &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIntField.html#a1a1de6a1836dfdb820c92b7f188a1b05">suffix</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the suffix string to be displayed after the field's value. <a href="#a1a1de6a1836dfdb820c92b7f188a1b05"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIntField.html#a9324bba994389f3a4563d9c18bd2f1cd">setSuffix</a> (const String &amp;suffix)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the <em>suffix</em> string to be displayed after the field's value. <a href="#a9324bba994389f3a4563d9c18bd2f1cd"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p><a class="el" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> that manages the input of an integer value. </p>
<p><a class="el" href="classIntField.html" title="Field that manages the input of an integer value.">IntField</a> is intended for field values that are modifiable by the user. Pressing Up adds <a class="el" href="classIntField.html#a49025ee3473fe066a6a6c546af98bfbd" title="Returns the step value to use when increasing or decreasing the value() due to Up and Down button pre...">stepValue()</a> to the current value and pressing Down subtracts <a class="el" href="classIntField.html#a49025ee3473fe066a6a6c546af98bfbd" title="Returns the step value to use when increasing or decreasing the value() due to Up and Down button pre...">stepValue()</a> from the current value. The value is clamped to the range <a class="el" href="classIntField.html#af3dab3f2b46d29136d7a93ce46b0b8fb" title="Returns the minimum value for the input field.">minValue()</a> to <a class="el" href="classIntField.html#aaa0adcb0d16e822e5f176be5cb9ca8ad" title="Returns the maximum value for the input field.">maxValue()</a>.</p>
<p>The following example creates an integer field with the label "Iterations", that ranges between 1 and 5, with a <a class="el" href="classIntField.html#a49025ee3473fe066a6a6c546af98bfbd" title="Returns the step value to use when increasing or decreasing the value() due to Up and Down button pre...">stepValue()</a> of 1, and an initial default <a class="el" href="classIntField.html#a2fb650827ce8cb4662253bb6c32acb52" title="Returns the current value of this field.">value()</a> of 2:</p>
<div class="fragment"><pre class="fragment"> <a class="code" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> mainForm(lcd);
<a class="code" href="classIntField.html" title="Field that manages the input of an integer value.">IntField</a> iterField(mainForm, <span class="stringliteral">&quot;Iterations&quot;</span>, 1, 5, 1, 2);
</pre></div><p><a class="el" href="classIntField.html" title="Field that manages the input of an integer value.">IntField</a> can be configured to show a <a class="el" href="classIntField.html#a1a1de6a1836dfdb820c92b7f188a1b05" title="Returns the suffix string to be displayed after the field&#39;s value.">suffix()</a> on the screen after the integer <a class="el" href="classIntField.html#a2fb650827ce8cb4662253bb6c32acb52" title="Returns the current value of this field.">value()</a>. This is intended for communicating the units in which the value is expressed. For example:</p>
<div class="fragment"><pre class="fragment"> <a class="code" href="classIntField.html" title="Field that manages the input of an integer value.">IntField</a> volumeField(mainForm, <span class="stringliteral">&quot;Volume&quot;</span>, 0, 100, 5, 85, <span class="stringliteral">&quot;%&quot;</span>);
<a class="code" href="classIntField.html" title="Field that manages the input of an integer value.">IntField</a> speedField(mainForm, <span class="stringliteral">&quot;Speed&quot;</span>, 0, 2000, 15, 450, <span class="stringliteral">&quot; rpm&quot;</span>);
</pre></div><div class="image">
<img src="FormInt.png" alt="FormInt.png"/>
</div>
<p>Use <a class="el" href="classTextField.html" title="Field that displays a read-only text value.">TextField</a> for read-only fields that report integer values but which are not modifiable by the user.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a>, <a class="el" href="classTextField.html" title="Field that displays a read-only text value.">TextField</a> </dd></dl>
<p>Definition at line <a class="el" href="IntField_8h_source.html#l00028">28</a> of file <a class="el" href="IntField_8h_source.html">IntField.h</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a9df274c4100ed37d2d78738f09fc53b6"></a><!-- doxytag: member="IntField::IntField" ref="a9df274c4100ed37d2d78738f09fc53b6" args="(const String &amp;label)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">IntField::IntField </td>
<td>(</td>
<td class="paramtype">const String &amp;&#160;</td>
<td class="paramname"><em>label</em></td><td>)</td>
<td><code> [explicit]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs a new integer field with a specific <em>label</em>. </p>
<p>The field is initially not associated with a <a class="el" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a>. The field can be added to a form later using <a class="el" href="classForm.html#a5cb056ace428e75e321610555bfecac7" title="Adds field to this form.">Form::addField()</a>.</p>
<p>Initially, <a class="el" href="classIntField.html#a2fb650827ce8cb4662253bb6c32acb52" title="Returns the current value of this field.">value()</a> is 0, <a class="el" href="classIntField.html#af3dab3f2b46d29136d7a93ce46b0b8fb" title="Returns the minimum value for the input field.">minValue()</a> is 0, <a class="el" href="classIntField.html#aaa0adcb0d16e822e5f176be5cb9ca8ad" title="Returns the maximum value for the input field.">maxValue()</a> is 100, <a class="el" href="classIntField.html#a49025ee3473fe066a6a6c546af98bfbd" title="Returns the step value to use when increasing or decreasing the value() due to Up and Down button pre...">stepValue()</a> is 1, and <a class="el" href="classIntField.html#a1a1de6a1836dfdb820c92b7f188a1b05" title="Returns the suffix string to be displayed after the field&#39;s value.">suffix()</a> is an empty string.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classForm.html#a5cb056ace428e75e321610555bfecac7" title="Adds field to this form.">Form::addField()</a> </dd></dl>
<p>Definition at line <a class="el" href="IntField_8cpp_source.html#l00071">71</a> of file <a class="el" href="IntField_8cpp_source.html">IntField.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a10c9c958bcde276698f1f1f9bff949dd"></a><!-- doxytag: member="IntField::IntField" ref="a10c9c958bcde276698f1f1f9bff949dd" args="(Form &amp;form, const String &amp;label, int minValue, int maxValue, int stepValue, int value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">IntField::IntField </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classForm.html">Form</a> &amp;&#160;</td>
<td class="paramname"><em>form</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const String &amp;&#160;</td>
<td class="paramname"><em>label</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>minValue</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>maxValue</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>stepValue</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>value</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs a new integer field with a specific <em>label</em>, <em>minValue</em>, <em>maxValue</em>, <em>stepValue</em>, and <em>value</em>, and attaches it to a <em>form</em>. </p>
<p>The <a class="el" href="classIntField.html#a1a1de6a1836dfdb820c92b7f188a1b05" title="Returns the suffix string to be displayed after the field&#39;s value.">suffix()</a> is initially set to an empty string. </p>
<p>Definition at line <a class="el" href="IntField_8cpp_source.html#l00088">88</a> of file <a class="el" href="IntField_8cpp_source.html">IntField.cpp</a>.</p>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a01a17d5a89c76c42c4f0516984ce653f"></a><!-- doxytag: member="IntField::dispatch" ref="a01a17d5a89c76c42c4f0516984ce653f" args="(int event)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int IntField::dispatch </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>event</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Dispatches <em>event</em> via this field. </p>
<p>The <em>event</em> is usually obtained from <a class="el" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292" title="Gets the next button press, release, or idle event.">LCD::getButton()</a>.</p>
<p>Returns zero if the <em>event</em> has been handled and no further action is required.</p>
<p>Returns FORM_CHANGED if the <em>event</em> has changed the value of this field in a manner that may require the application to take further action based on the new field value.</p>
<p>Returns -1 if the <em>event</em> is not handled by this field, and should be handled by the <a class="el" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> itself (particularly for Left and Right buttons). The default implementation returns -1 for all events.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classForm.html#a89bd3850e87caa2ca7b2e946f923d0ee" title="Dispatches event to the currently active field using Field::dispatch().">Form::dispatch()</a>, <a class="el" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292" title="Gets the next button press, release, or idle event.">LCD::getButton()</a> </dd></dl>
<p>Reimplemented from <a class="el" href="classField.html#a061bd1ed4d8b079df86465df8facd3b3">Field</a>.</p>
<p>Definition at line <a class="el" href="IntField_8cpp_source.html#l00114">114</a> of file <a class="el" href="IntField_8cpp_source.html">IntField.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a51d9127b660e8dd7f87718acd230202a"></a><!-- doxytag: member="IntField::enterField" ref="a51d9127b660e8dd7f87718acd230202a" args="(bool reverse)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void IntField::enterField </td>
<td>(</td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>reverse</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Enters the field due to form navigation. </p>
<p>This function is typically called when the user presses Left and Right buttons to navigate to the field. If <em>reverse</em> is true, then navigation was due to the Left button being pressed.</p>
<p>This function can assume that the display has been cleared and the cursor is positioned at (0, 0).</p>
<p>The default implementation prints the <a class="el" href="classField.html#aaa861ef917130c989a955bc75c683afe" title="Returns the label to display in the first line of this field.">label()</a>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classField.html#ad6805c75ee1e62f8cd8bd550c4530c07" title="Exits the field due to form navigation.">exitField()</a> </dd></dl>
<p>Reimplemented from <a class="el" href="classField.html#aa032bbeacb405c56546cb56fbbee94f5">Field</a>.</p>
<p>Definition at line <a class="el" href="IntField_8cpp_source.html#l00126">126</a> of file <a class="el" href="IntField_8cpp_source.html">IntField.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aaa0adcb0d16e822e5f176be5cb9ca8ad"></a><!-- doxytag: member="IntField::maxValue" ref="aaa0adcb0d16e822e5f176be5cb9ca8ad" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int IntField::maxValue </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the maximum value for the input field. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classIntField.html#a36cbd7c24480cc3fcf0c7634d5e22bf1" title="Sets the maximum value for the input field.">setMaxValue()</a>, <a class="el" href="classIntField.html#af3dab3f2b46d29136d7a93ce46b0b8fb" title="Returns the minimum value for the input field.">minValue()</a>, <a class="el" href="classIntField.html#a49025ee3473fe066a6a6c546af98bfbd" title="Returns the step value to use when increasing or decreasing the value() due to Up and Down button pre...">stepValue()</a>, <a class="el" href="classIntField.html#a2fb650827ce8cb4662253bb6c32acb52" title="Returns the current value of this field.">value()</a> </dd></dl>
<p>Definition at line <a class="el" href="IntField_8h_source.html#l00041">41</a> of file <a class="el" href="IntField_8h_source.html">IntField.h</a>.</p>
</div>
</div>
<a class="anchor" id="af3dab3f2b46d29136d7a93ce46b0b8fb"></a><!-- doxytag: member="IntField::minValue" ref="af3dab3f2b46d29136d7a93ce46b0b8fb" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int IntField::minValue </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the minimum value for the input field. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classIntField.html#afffe7be6721a043cec7a5a85c19e0ada" title="Sets the minimum value for the input field.">setMinValue()</a>, <a class="el" href="classIntField.html#aaa0adcb0d16e822e5f176be5cb9ca8ad" title="Returns the maximum value for the input field.">maxValue()</a>, <a class="el" href="classIntField.html#a49025ee3473fe066a6a6c546af98bfbd" title="Returns the step value to use when increasing or decreasing the value() due to Up and Down button pre...">stepValue()</a>, <a class="el" href="classIntField.html#a2fb650827ce8cb4662253bb6c32acb52" title="Returns the current value of this field.">value()</a> </dd></dl>
<p>Definition at line <a class="el" href="IntField_8h_source.html#l00038">38</a> of file <a class="el" href="IntField_8h_source.html">IntField.h</a>.</p>
</div>
</div>
<a class="anchor" id="a36cbd7c24480cc3fcf0c7634d5e22bf1"></a><!-- doxytag: member="IntField::setMaxValue" ref="a36cbd7c24480cc3fcf0c7634d5e22bf1" args="(int value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void IntField::setMaxValue </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the maximum <em>value</em> for the input field. </p>
<p>The new maximum <em>value</em> will be used to clamp the field's value the next time <a class="el" href="classIntField.html#aed421e2c52946f2c7643534b4f6f13f7" title="Sets the current value of this field.">setValue()</a> is called.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classIntField.html#aaa0adcb0d16e822e5f176be5cb9ca8ad" title="Returns the maximum value for the input field.">maxValue()</a>, <a class="el" href="classIntField.html#afffe7be6721a043cec7a5a85c19e0ada" title="Sets the minimum value for the input field.">setMinValue()</a>, <a class="el" href="classIntField.html#a8fb6e207bd906062bb788e19dbe58bcb" title="Sets the step value value to use when increasing or decreasing the value() due to Up and Down button ...">setStepValue()</a>, <a class="el" href="classIntField.html#aed421e2c52946f2c7643534b4f6f13f7" title="Sets the current value of this field.">setValue()</a> </dd></dl>
<p>Definition at line <a class="el" href="IntField_8h_source.html#l00042">42</a> of file <a class="el" href="IntField_8h_source.html">IntField.h</a>.</p>
</div>
</div>
<a class="anchor" id="afffe7be6721a043cec7a5a85c19e0ada"></a><!-- doxytag: member="IntField::setMinValue" ref="afffe7be6721a043cec7a5a85c19e0ada" args="(int value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void IntField::setMinValue </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the minimum <em>value</em> for the input field. </p>
<p>The new minimum <em>value</em> will be used to clamp the field's value the next time <a class="el" href="classIntField.html#aed421e2c52946f2c7643534b4f6f13f7" title="Sets the current value of this field.">setValue()</a> is called.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classIntField.html#af3dab3f2b46d29136d7a93ce46b0b8fb" title="Returns the minimum value for the input field.">minValue()</a>, <a class="el" href="classIntField.html#a36cbd7c24480cc3fcf0c7634d5e22bf1" title="Sets the maximum value for the input field.">setMaxValue()</a>, <a class="el" href="classIntField.html#a8fb6e207bd906062bb788e19dbe58bcb" title="Sets the step value value to use when increasing or decreasing the value() due to Up and Down button ...">setStepValue()</a>, <a class="el" href="classIntField.html#aed421e2c52946f2c7643534b4f6f13f7" title="Sets the current value of this field.">setValue()</a> </dd></dl>
<p>Definition at line <a class="el" href="IntField_8h_source.html#l00039">39</a> of file <a class="el" href="IntField_8h_source.html">IntField.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8fb6e207bd906062bb788e19dbe58bcb"></a><!-- doxytag: member="IntField::setStepValue" ref="a8fb6e207bd906062bb788e19dbe58bcb" args="(int value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void IntField::setStepValue </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the step value <em>value</em> to use when increasing or decreasing the <a class="el" href="classIntField.html#a2fb650827ce8cb4662253bb6c32acb52" title="Returns the current value of this field.">value()</a> due to Up and Down button presses. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classIntField.html#a49025ee3473fe066a6a6c546af98bfbd" title="Returns the step value to use when increasing or decreasing the value() due to Up and Down button pre...">stepValue()</a>, <a class="el" href="classIntField.html#afffe7be6721a043cec7a5a85c19e0ada" title="Sets the minimum value for the input field.">setMinValue()</a>, <a class="el" href="classIntField.html#a36cbd7c24480cc3fcf0c7634d5e22bf1" title="Sets the maximum value for the input field.">setMaxValue()</a>, <a class="el" href="classIntField.html#aed421e2c52946f2c7643534b4f6f13f7" title="Sets the current value of this field.">setValue()</a> </dd></dl>
<p>Definition at line <a class="el" href="IntField_8h_source.html#l00045">45</a> of file <a class="el" href="IntField_8h_source.html">IntField.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9324bba994389f3a4563d9c18bd2f1cd"></a><!-- doxytag: member="IntField::setSuffix" ref="a9324bba994389f3a4563d9c18bd2f1cd" args="(const String &amp;suffix)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void IntField::setSuffix </td>
<td>(</td>
<td class="paramtype">const String &amp;&#160;</td>
<td class="paramname"><em>suffix</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the <em>suffix</em> string to be displayed after the field's value. </p>
<p>Suffixes are typically used to indicate the units that the <a class="el" href="classIntField.html#a2fb650827ce8cb4662253bb6c32acb52" title="Returns the current value of this field.">value()</a> is expressed in. For example:</p>
<div class="fragment"><pre class="fragment"> field.setSuffix(<span class="stringliteral">&quot;%&quot;</span>);
field.setSuffix(<span class="stringliteral">&quot; rpm&quot;</span>);
</pre></div><dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classIntField.html#a1a1de6a1836dfdb820c92b7f188a1b05" title="Returns the suffix string to be displayed after the field&#39;s value.">suffix()</a> </dd></dl>
<p>Definition at line <a class="el" href="IntField_8cpp_source.html#l00231">231</a> of file <a class="el" href="IntField_8cpp_source.html">IntField.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aed421e2c52946f2c7643534b4f6f13f7"></a><!-- doxytag: member="IntField::setValue" ref="aed421e2c52946f2c7643534b4f6f13f7" args="(int value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void IntField::setValue </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the current <em>value</em> of this field. </p>
<p>The <em>value</em> will be clamped to the range defined by <a class="el" href="classIntField.html#af3dab3f2b46d29136d7a93ce46b0b8fb" title="Returns the minimum value for the input field.">minValue()</a> and <a class="el" href="classIntField.html#aaa0adcb0d16e822e5f176be5cb9ca8ad" title="Returns the maximum value for the input field.">maxValue()</a>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classIntField.html#a2fb650827ce8cb4662253bb6c32acb52" title="Returns the current value of this field.">value()</a>, <a class="el" href="classIntField.html#afffe7be6721a043cec7a5a85c19e0ada" title="Sets the minimum value for the input field.">setMinValue()</a>, <a class="el" href="classIntField.html#a36cbd7c24480cc3fcf0c7634d5e22bf1" title="Sets the maximum value for the input field.">setMaxValue()</a>, <a class="el" href="classIntField.html#a8fb6e207bd906062bb788e19dbe58bcb" title="Sets the step value value to use when increasing or decreasing the value() due to Up and Down button ...">setStepValue()</a> </dd></dl>
<p>Definition at line <a class="el" href="IntField_8cpp_source.html#l00198">198</a> of file <a class="el" href="IntField_8cpp_source.html">IntField.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a49025ee3473fe066a6a6c546af98bfbd"></a><!-- doxytag: member="IntField::stepValue" ref="a49025ee3473fe066a6a6c546af98bfbd" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int IntField::stepValue </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the step value to use when increasing or decreasing the <a class="el" href="classIntField.html#a2fb650827ce8cb4662253bb6c32acb52" title="Returns the current value of this field.">value()</a> due to Up and Down button presses. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classIntField.html#a8fb6e207bd906062bb788e19dbe58bcb" title="Sets the step value value to use when increasing or decreasing the value() due to Up and Down button ...">setStepValue()</a>, <a class="el" href="classIntField.html#af3dab3f2b46d29136d7a93ce46b0b8fb" title="Returns the minimum value for the input field.">minValue()</a>, <a class="el" href="classIntField.html#aaa0adcb0d16e822e5f176be5cb9ca8ad" title="Returns the maximum value for the input field.">maxValue()</a>, <a class="el" href="classIntField.html#a2fb650827ce8cb4662253bb6c32acb52" title="Returns the current value of this field.">value()</a> </dd></dl>
<p>Definition at line <a class="el" href="IntField_8h_source.html#l00044">44</a> of file <a class="el" href="IntField_8h_source.html">IntField.h</a>.</p>
</div>
</div>
<a class="anchor" id="a1a1de6a1836dfdb820c92b7f188a1b05"></a><!-- doxytag: member="IntField::suffix" ref="a1a1de6a1836dfdb820c92b7f188a1b05" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const String &amp; IntField::suffix </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the suffix string to be displayed after the field's value. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classIntField.html#a9324bba994389f3a4563d9c18bd2f1cd" title="Sets the suffix string to be displayed after the field&#39;s value.">setSuffix()</a> </dd></dl>
<p>Definition at line <a class="el" href="IntField_8h_source.html#l00050">50</a> of file <a class="el" href="IntField_8h_source.html">IntField.h</a>.</p>
</div>
</div>
<a class="anchor" id="a2fb650827ce8cb4662253bb6c32acb52"></a><!-- doxytag: member="IntField::value" ref="a2fb650827ce8cb4662253bb6c32acb52" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int IntField::value </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the current value of this field. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classIntField.html#aed421e2c52946f2c7643534b4f6f13f7" title="Sets the current value of this field.">setValue()</a>, <a class="el" href="classIntField.html#af3dab3f2b46d29136d7a93ce46b0b8fb" title="Returns the minimum value for the input field.">minValue()</a>, <a class="el" href="classIntField.html#aaa0adcb0d16e822e5f176be5cb9ca8ad" title="Returns the maximum value for the input field.">maxValue()</a>, <a class="el" href="classIntField.html#a49025ee3473fe066a6a6c546af98bfbd" title="Returns the step value to use when increasing or decreasing the value() due to Up and Down button pre...">stepValue()</a> </dd></dl>
<p>Definition at line <a class="el" href="IntField_8h_source.html#l00047">47</a> of file <a class="el" href="IntField_8h_source.html">IntField.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="IntField_8h_source.html">IntField.h</a></li>
<li><a class="el" href="IntField_8cpp_source.html">IntField.cpp</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

BIN
classIntField.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

101
classLCD-members.html Normal file
View File

@ -0,0 +1,101 @@
<!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"/>
<title>ArduinoLibs: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">LCD Member List</div> </div>
</div>
<div class="contents">
This is the complete list of members for <a class="el" href="classLCD.html">LCD</a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28a9931c078cfd1023c69f1da431f9a656c">BacklightOff</a> enum value</td><td><a class="el" href="classLCD.html">LCD</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28a781f3c5e42506bf4f86ba06d69b23d35">BacklightOnSelect</a> enum value</td><td><a class="el" href="classLCD.html">LCD</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classLCD.html#a85c3a4694b105731404df36e35e5b26e">disableScreenSaver</a>()</td><td><a class="el" href="classLCD.html">LCD</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classLCD.html#a5b07cf05e8e5e7c53654f5ca0cf58b89">display</a>()</td><td><a class="el" href="classLCD.html">LCD</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28a3f1e62d5fcd314d6ff067d3e74c4bf5f">DisplayOff</a> enum value</td><td><a class="el" href="classLCD.html">LCD</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classLCD.html#af9a2326d034fa159d384ec16223c924f">enableScreenSaver</a>(int timeoutSecs=10)</td><td><a class="el" href="classLCD.html">LCD</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292">getButton</a>()</td><td><a class="el" href="classLCD.html">LCD</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classLCD.html#af5d5ca618a3161aa352027b58fe09d0e">isScreenSaved</a>() const </td><td><a class="el" href="classLCD.html">LCD</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classLCD.html#a00bb2db1390721abc7b24ac4b8c276c8">LCD</a>()</td><td><a class="el" href="classLCD.html">LCD</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classLCD.html#a067bc741cf27f143aba5d9f147908401">LCD</a>(uint8_t pin9)</td><td><a class="el" href="classLCD.html">LCD</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classLCD.html#af3974da6d988ba2d21c25135ada12108">noDisplay</a>()</td><td><a class="el" href="classLCD.html">LCD</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classLCD.html#a1917fa285f81f476b4c7cc20d15456b8">screenSaverMode</a>() const </td><td><a class="el" href="classLCD.html">LCD</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28">ScreenSaverMode</a> enum name</td><td><a class="el" href="classLCD.html">LCD</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classLCD.html#a56d1f68532c779c65fbbd071fb444801">setScreenSaverMode</a>(ScreenSaverMode mode)</td><td><a class="el" href="classLCD.html">LCD</a></td><td></td></tr>
</table></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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

413
classLCD.html Normal file
View File

@ -0,0 +1,413 @@
<!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"/>
<title>ArduinoLibs: LCD Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> </div>
<div class="headertitle">
<div class="title">LCD Class Reference</div> </div>
</div>
<div class="contents">
<!-- doxytag: class="LCD" -->
<p>Enhanced library for Freetronics 16x2 <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> shields.
<a href="classLCD.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="LCD_8h_source.html">LCD.h</a>&gt;</code></p>
<p><a href="classLCD-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28">ScreenSaverMode</a> { <a class="el" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28a3f1e62d5fcd314d6ff067d3e74c4bf5f">DisplayOff</a>,
<a class="el" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28a9931c078cfd1023c69f1da431f9a656c">BacklightOff</a>,
<a class="el" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28a781f3c5e42506bf4f86ba06d69b23d35">BacklightOnSelect</a>
}</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Screen saver mode that controls the display and back light. <a href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLCD.html#a00bb2db1390721abc7b24ac4b8c276c8">LCD</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the Freetronics <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> display with the default pin assignment. <a href="#a00bb2db1390721abc7b24ac4b8c276c8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLCD.html#a067bc741cf27f143aba5d9f147908401">LCD</a> (uint8_t pin9)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the Freetronics <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> display for USBDroid. <a href="#a067bc741cf27f143aba5d9f147908401"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLCD.html#a5b07cf05e8e5e7c53654f5ca0cf58b89">display</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Turns on the display of text on the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> and the back light. <a href="#a5b07cf05e8e5e7c53654f5ca0cf58b89"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLCD.html#af3974da6d988ba2d21c25135ada12108">noDisplay</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Turns off the display of text on the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> and the back light. <a href="#af3974da6d988ba2d21c25135ada12108"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28">ScreenSaverMode</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLCD.html#a1917fa285f81f476b4c7cc20d15456b8">screenSaverMode</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current screen saver mode; default is DisplayOff. <a href="#a1917fa285f81f476b4c7cc20d15456b8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLCD.html#a56d1f68532c779c65fbbd071fb444801">setScreenSaverMode</a> (<a class="el" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28">ScreenSaverMode</a> mode)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the current screen saver <em>mode</em>. <a href="#a56d1f68532c779c65fbbd071fb444801"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLCD.html#af9a2326d034fa159d384ec16223c924f">enableScreenSaver</a> (int timeoutSecs=10)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables the screen saver and causes it to activate after <em>timeoutSecs</em> of inactivity on the buttons. <a href="#af9a2326d034fa159d384ec16223c924f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLCD.html#a85c3a4694b105731404df36e35e5b26e">disableScreenSaver</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Disables the screen saver. <a href="#a85c3a4694b105731404df36e35e5b26e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLCD.html#af5d5ca618a3161aa352027b58fe09d0e">isScreenSaved</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the screen has been saved; false otherwise. <a href="#af5d5ca618a3161aa352027b58fe09d0e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292">getButton</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the next button press, release, or idle event. <a href="#ac1e80e2603bd1cf0276c36092c416292"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Enhanced library for Freetronics 16x2 <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> shields. </p>
<p>This class extends the standard Arduino LiquidCrystal library with extra functionality for the Freetronics 16x2 <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> shield:</p>
<p><a href="http://www.freetronics.com/pages/16x2-lcd-shield-quickstart-guide">http://www.freetronics.com/pages/16x2-lcd-shield-quickstart-guide</a></p>
<p>The Freetronics <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> has an additional back light, which is turned on and off with the <a class="el" href="classLCD.html#a5b07cf05e8e5e7c53654f5ca0cf58b89" title="Turns on the display of text on the LCD and the back light.">display()</a> and <a class="el" href="classLCD.html#af3974da6d988ba2d21c25135ada12108" title="Turns off the display of text on the LCD and the back light.">noDisplay()</a> functions. The user can also call <a class="el" href="classLCD.html#af9a2326d034fa159d384ec16223c924f" title="Enables the screen saver and causes it to activate after timeoutSecs of inactivity on the buttons...">enableScreenSaver()</a> to cause the display and back light to automatically turn off after a specific timeout. The <a class="el" href="classLCD.html#a56d1f68532c779c65fbbd071fb444801" title="Sets the current screen saver mode.">setScreenSaverMode()</a> function controls which of the display and back light are disabled when the screen saver activates.</p>
<p>The Freetronics <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> also has 5 push buttons for Left, Right, Up, Down, and Select, to assist with the creation of interactive sketches. The user can call <a class="el" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292" title="Gets the next button press, release, or idle event.">getButton()</a> to get the current button state. One of the following values may be returned:</p>
<ul>
<li>LCD_BUTTON_NONE - No button has been pressed, or a button has been pressed but not yet released. </li>
<li>LCD_BUTTON_LEFT - Left button was pressed. </li>
<li>LCD_BUTTON_RIGHT - Right button was pressed. </li>
<li>LCD_BUTTON_UP - Up button was pressed. </li>
<li>LCD_BUTTON_DOWN - Down button was pressed. </li>
<li>LCD_BUTTON_SELECT - Select button was pressed. </li>
<li>LCD_BUTTON_LEFT_RELEASED - Left button was released. </li>
<li>LCD_BUTTON_RIGHT_RELEASED - Right button was released. </li>
<li>LCD_BUTTON_UP_RELEASED - Up button was released. </li>
<li>LCD_BUTTON_DOWN_RELEASED - Down button was released. </li>
<li>LCD_BUTTON_SELECT_RELEASED - Select button was released.</li>
</ul>
<p>For convenience, all RELEASED button codes are the negation of their pressed counterparts. That is, LCD_BUTTON_LEFT_RELEASED == -LCD_BUTTON_LEFT. LCD_BUTTON_NONE is defined to be zero. Thus, you can check if a generic button has been pressed with <code>button &gt; 0</code> and if a generic button has been released with <code>button &lt; 0</code>.</p>
<p>See the <a class="el" href="lcd_hello_world.html">Hello World</a> example for more information on using the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> class.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> </dd></dl>
<p>Definition at line <a class="el" href="LCD_8h_source.html#l00048">48</a> of file <a class="el" href="LCD_8h_source.html">LCD.h</a>.</p>
</div><hr/><h2>Member Enumeration Documentation</h2>
<a class="anchor" id="a264bf94308c95d8598426e13dc8cdb28"></a><!-- doxytag: member="LCD::ScreenSaverMode" ref="a264bf94308c95d8598426e13dc8cdb28" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28">LCD::ScreenSaverMode</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Screen saver mode that controls the display and back light. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="a264bf94308c95d8598426e13dc8cdb28a3f1e62d5fcd314d6ff067d3e74c4bf5f"></a><!-- doxytag: member="DisplayOff" ref="a264bf94308c95d8598426e13dc8cdb28a3f1e62d5fcd314d6ff067d3e74c4bf5f" args="" -->DisplayOff</em>&nbsp;</td><td>
<p>Turn off both the display and the backlight when the screen saver is activated. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a264bf94308c95d8598426e13dc8cdb28a9931c078cfd1023c69f1da431f9a656c"></a><!-- doxytag: member="BacklightOff" ref="a264bf94308c95d8598426e13dc8cdb28a9931c078cfd1023c69f1da431f9a656c" args="" -->BacklightOff</em>&nbsp;</td><td>
<p>Turn off the back light but leave the display on when the screen saver is activated. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a264bf94308c95d8598426e13dc8cdb28a781f3c5e42506bf4f86ba06d69b23d35"></a><!-- doxytag: member="BacklightOnSelect" ref="a264bf94308c95d8598426e13dc8cdb28a781f3c5e42506bf4f86ba06d69b23d35" args="" -->BacklightOnSelect</em>&nbsp;</td><td>
<p>Same as BacklightOff but the screen saver is only deactivated when Select is pressed; other buttons have no effect. </p>
</td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="LCD_8h_source.html#l00056">56</a> of file <a class="el" href="LCD_8h_source.html">LCD.h</a>.</p>
</div>
</div>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a00bb2db1390721abc7b24ac4b8c276c8"></a><!-- doxytag: member="LCD::LCD" ref="a00bb2db1390721abc7b24ac4b8c276c8" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LCD::LCD </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initialize the Freetronics <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> display with the default pin assignment. </p>
<p>The following example shows how to initialize the Freetronics <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> shield:</p>
<div class="fragment"><pre class="fragment"> <a class="code" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> lcd;
</pre></div>
<p>Definition at line <a class="el" href="LCD_8h_source.html#l00050">50</a> of file <a class="el" href="LCD_8h_source.html">LCD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a067bc741cf27f143aba5d9f147908401"></a><!-- doxytag: member="LCD::LCD" ref="a067bc741cf27f143aba5d9f147908401" args="(uint8_t pin9)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LCD::LCD </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>pin9</em></td><td>)</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initialize the Freetronics <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> display for USBDroid. </p>
<p>On the USBDroid, the D9 pin is used for USB Host functionality. Either the USB Host's use of D9 must be reassigned to another pin, or the Freetronics <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> shield must be modified. The following Web page describes the modifications that are necessary: <a href="http://www.freetronics.com/pages/combining-the-lcd-keypad-shield-and-the-usbdroid">http://www.freetronics.com/pages/combining-the-lcd-keypad-shield-and-the-usbdroid</a></p>
<p>If you choose to modify the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> shield, then you must use this version of the constructor to initialize the shield, passing the alternative pin as the <em>pin9</em> parameter. Using the recommended pin from the above Web page of A1, you would initialize the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> as follows:</p>
<div class="fragment"><pre class="fragment"> <a class="code" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> lcd(A1);
</pre></div>
<p>Definition at line <a class="el" href="LCD_8h_source.html#l00051">51</a> of file <a class="el" href="LCD_8h_source.html">LCD.h</a>.</p>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a85c3a4694b105731404df36e35e5b26e"></a><!-- doxytag: member="LCD::disableScreenSaver" ref="a85c3a4694b105731404df36e35e5b26e" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void LCD::disableScreenSaver </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Disables the screen saver. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classLCD.html#af9a2326d034fa159d384ec16223c924f" title="Enables the screen saver and causes it to activate after timeoutSecs of inactivity on the buttons...">enableScreenSaver()</a>, <a class="el" href="classLCD.html#a5b07cf05e8e5e7c53654f5ca0cf58b89" title="Turns on the display of text on the LCD and the back light.">display()</a>, <a class="el" href="classLCD.html#af5d5ca618a3161aa352027b58fe09d0e" title="Returns true if the screen has been saved; false otherwise.">isScreenSaved()</a> </dd></dl>
<p>Definition at line <a class="el" href="LCD_8cpp_source.html#l00246">246</a> of file <a class="el" href="LCD_8cpp_source.html">LCD.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a5b07cf05e8e5e7c53654f5ca0cf58b89"></a><!-- doxytag: member="LCD::display" ref="a5b07cf05e8e5e7c53654f5ca0cf58b89" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void LCD::display </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Turns on the display of text on the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> and the back light. </p>
<p>If the screen saver is active, then calling this function will deactivate the screen saver and reset the timeout. Thus, this function can be called for force the screen to restore.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classLCD.html#af3974da6d988ba2d21c25135ada12108" title="Turns off the display of text on the LCD and the back light.">noDisplay()</a>, <a class="el" href="classLCD.html#af9a2326d034fa159d384ec16223c924f" title="Enables the screen saver and causes it to activate after timeoutSecs of inactivity on the buttons...">enableScreenSaver()</a>, <a class="el" href="classLCD.html#a56d1f68532c779c65fbbd071fb444801" title="Sets the current screen saver mode.">setScreenSaverMode()</a> </dd></dl>
<p>Definition at line <a class="el" href="LCD_8cpp_source.html#l00148">148</a> of file <a class="el" href="LCD_8cpp_source.html">LCD.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="af9a2326d034fa159d384ec16223c924f"></a><!-- doxytag: member="LCD::enableScreenSaver" ref="af9a2326d034fa159d384ec16223c924f" args="(int timeoutSecs=10)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void LCD::enableScreenSaver </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>timeoutSecs</em> = <code>10</code></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Enables the screen saver and causes it to activate after <em>timeoutSecs</em> of inactivity on the buttons. </p>
<p>If <em>timeoutSecs</em> is less than or equal to zero, then the call is equivalent to calling <a class="el" href="classLCD.html#a85c3a4694b105731404df36e35e5b26e" title="Disables the screen saver.">disableScreenSaver()</a>.</p>
<p>For the screen saver to work, the application must regularly call <a class="el" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292" title="Gets the next button press, release, or idle event.">getButton()</a> to fetch the LCD's button state even if no buttons are pressed.</p>
<p>If the <em>timeoutSecs</em> parameter is not supplied, the default is 10 seconds.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classLCD.html#a85c3a4694b105731404df36e35e5b26e" title="Disables the screen saver.">disableScreenSaver()</a>, <a class="el" href="classLCD.html#a5b07cf05e8e5e7c53654f5ca0cf58b89" title="Turns on the display of text on the LCD and the back light.">display()</a>, <a class="el" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292" title="Gets the next button press, release, or idle event.">getButton()</a>, <a class="el" href="classLCD.html#af5d5ca618a3161aa352027b58fe09d0e" title="Returns true if the screen has been saved; false otherwise.">isScreenSaved()</a> </dd></dl>
<p>Definition at line <a class="el" href="LCD_8cpp_source.html#l00232">232</a> of file <a class="el" href="LCD_8cpp_source.html">LCD.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ac1e80e2603bd1cf0276c36092c416292"></a><!-- doxytag: member="LCD::getButton" ref="ac1e80e2603bd1cf0276c36092c416292" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int LCD::getButton </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Gets the next button press, release, or idle event. </p>
<p>If no buttons are pressed, this function will return LCD_BUTTON_NONE.</p>
<p>When a button is pressed, this function will return one of LCD_BUTTON_LEFT, LCD_BUTTON_RIGHT, LCD_BUTTON_UP, LCD_BUTTON_DOWN, or LCD_BUTTON_SELECT. While the button is pressed, this function will return LCD_BUTTON_NONE until the button is released. When the button is released, this function will return one of LCD_BUTTON_LEFT_RELEASED, LCD_BUTTON_RIGHT_RELEASED, LCD_BUTTON_UP_RELEAED, LCD_BUTTON_DOWN_RELEASED, or LCD_BUTTON_SELECT_RELEASED.</p>
<p>If the screen saver is currently active, then it will be deactivated by this function whenever a button is pressed. If <a class="el" href="classLCD.html#a1917fa285f81f476b4c7cc20d15456b8" title="Returns the current screen saver mode; default is DisplayOff.">screenSaverMode()</a> is DisplayOff, the function will "eat" the button press and return LCD_BUTTON_NONE. The scrren saver can also be deactivated under program control by calling <a class="el" href="classLCD.html#a5b07cf05e8e5e7c53654f5ca0cf58b89" title="Turns on the display of text on the LCD and the back light.">display()</a>.</p>
<p>This function debounces the button state automatically so there is no need for the caller to worry about spurious button events.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classLCD.html#af9a2326d034fa159d384ec16223c924f" title="Enables the screen saver and causes it to activate after timeoutSecs of inactivity on the buttons...">enableScreenSaver()</a>, <a class="el" href="classLCD.html#a5b07cf05e8e5e7c53654f5ca0cf58b89" title="Turns on the display of text on the LCD and the back light.">display()</a>, <a class="el" href="classForm.html#a89bd3850e87caa2ca7b2e946f923d0ee" title="Dispatches event to the currently active field using Field::dispatch().">Form::dispatch()</a> </dd></dl>
<p>Definition at line <a class="el" href="LCD_8cpp_source.html#l00291">291</a> of file <a class="el" href="LCD_8cpp_source.html">LCD.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="af5d5ca618a3161aa352027b58fe09d0e"></a><!-- doxytag: member="LCD::isScreenSaved" ref="af5d5ca618a3161aa352027b58fe09d0e" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool LCD::isScreenSaved </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns true if the screen has been saved; false otherwise. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classLCD.html#af9a2326d034fa159d384ec16223c924f" title="Enables the screen saver and causes it to activate after timeoutSecs of inactivity on the buttons...">enableScreenSaver()</a> </dd></dl>
<p>Definition at line <a class="el" href="LCD_8h_source.html#l00068">68</a> of file <a class="el" href="LCD_8h_source.html">LCD.h</a>.</p>
</div>
</div>
<a class="anchor" id="af3974da6d988ba2d21c25135ada12108"></a><!-- doxytag: member="LCD::noDisplay" ref="af3974da6d988ba2d21c25135ada12108" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void LCD::noDisplay </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Turns off the display of text on the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> and the back light. </p>
<p>This function can be called to force the screen saver to activate.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classLCD.html#a5b07cf05e8e5e7c53654f5ca0cf58b89" title="Turns on the display of text on the LCD and the back light.">display()</a>, <a class="el" href="classLCD.html#af9a2326d034fa159d384ec16223c924f" title="Enables the screen saver and causes it to activate after timeoutSecs of inactivity on the buttons...">enableScreenSaver()</a>, <a class="el" href="classLCD.html#a56d1f68532c779c65fbbd071fb444801" title="Sets the current screen saver mode.">setScreenSaverMode()</a> </dd></dl>
<p>Definition at line <a class="el" href="LCD_8cpp_source.html#l00163">163</a> of file <a class="el" href="LCD_8cpp_source.html">LCD.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a1917fa285f81f476b4c7cc20d15456b8"></a><!-- doxytag: member="LCD::screenSaverMode" ref="a1917fa285f81f476b4c7cc20d15456b8" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28">ScreenSaverMode</a> LCD::screenSaverMode </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the current screen saver mode; default is DisplayOff. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classLCD.html#a56d1f68532c779c65fbbd071fb444801" title="Sets the current screen saver mode.">setScreenSaverMode()</a>, <a class="el" href="classLCD.html#af9a2326d034fa159d384ec16223c924f" title="Enables the screen saver and causes it to activate after timeoutSecs of inactivity on the buttons...">enableScreenSaver()</a> </dd></dl>
<p>Definition at line <a class="el" href="LCD_8h_source.html#l00063">63</a> of file <a class="el" href="LCD_8h_source.html">LCD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a56d1f68532c779c65fbbd071fb444801"></a><!-- doxytag: member="LCD::setScreenSaverMode" ref="a56d1f68532c779c65fbbd071fb444801" args="(ScreenSaverMode mode)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void LCD::setScreenSaverMode </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classLCD.html#a264bf94308c95d8598426e13dc8cdb28">ScreenSaverMode</a>&#160;</td>
<td class="paramname"><em>mode</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the current screen saver <em>mode</em>. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classLCD.html#a1917fa285f81f476b4c7cc20d15456b8" title="Returns the current screen saver mode; default is DisplayOff.">screenSaverMode()</a>, <a class="el" href="classLCD.html#af9a2326d034fa159d384ec16223c924f" title="Enables the screen saver and causes it to activate after timeoutSecs of inactivity on the buttons...">enableScreenSaver()</a> </dd></dl>
<p>Definition at line <a class="el" href="LCD_8cpp_source.html#l00206">206</a> of file <a class="el" href="LCD_8cpp_source.html">LCD.cpp</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="LCD_8h_source.html">LCD.h</a></li>
<li><a class="el" href="LCD_8cpp_source.html">LCD.cpp</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

105
classListField-members.html Normal file
View File

@ -0,0 +1,105 @@
<!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"/>
<title>ArduinoLibs: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">ListField Member List</div> </div>
</div>
<div class="contents">
This is the complete list of members for <a class="el" href="classListField.html">ListField</a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="classListField.html#a5d752bd561cde735b175bcdfda55832a">dispatch</a>(int event)</td><td><a class="el" href="classListField.html">ListField</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classListField.html#a191b79b460e45cf48e04b04eface2888">enterField</a>(bool reverse)</td><td><a class="el" href="classListField.html">ListField</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#ad6805c75ee1e62f8cd8bd550c4530c07">exitField</a>()</td><td><a class="el" href="classField.html">Field</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#ac4ea0d104376233c3f0bfc080ec8564e">Field</a>(const String &amp;label)</td><td><a class="el" href="classField.html">Field</a></td><td><code> [explicit]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#a7e2bdb203ddfd9219696f263c1731fe7">Field</a>(Form &amp;form, const String &amp;label)</td><td><a class="el" href="classField.html">Field</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#a27427319be1cc92db3128637d8884ee5">form</a>() const </td><td><a class="el" href="classField.html">Field</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#a25d86a67b321e8c642edf75a10a35f72">isCurrent</a>() const </td><td><a class="el" href="classField.html">Field</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classListField.html#a4dbbdeebd386551eb8f245b42b45ccf0">items</a>() const </td><td><a class="el" href="classListField.html">ListField</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#aaa861ef917130c989a955bc75c683afe">label</a>() const </td><td><a class="el" href="classField.html">Field</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1">lcd</a>() const </td><td><a class="el" href="classField.html">Field</a></td><td><code> [inline, protected]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classListField.html#a118501da7edb0b0bc6b493734975b4e9">ListField</a>(const String &amp;label)</td><td><a class="el" href="classListField.html">ListField</a></td><td><code> [explicit]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classListField.html#aa303898a1f74b52c1c4982653de488b7">ListField</a>(Form &amp;form, const String &amp;label, ListItems items, int value=0)</td><td><a class="el" href="classListField.html">ListField</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classListField.html#ae6709bce9355451b651893691456704e">setItems</a>(ListItems items)</td><td><a class="el" href="classListField.html">ListField</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#ad4ea63599d780c35b296cf2840b69f7b">setLabel</a>(const String &amp;label)</td><td><a class="el" href="classField.html">Field</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classListField.html#a266193631e897fb0b46e1270b1d0eb24">setValue</a>(int value)</td><td><a class="el" href="classListField.html">ListField</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#afc612378167be0e7f8a6f8395b3537bd">updateCursor</a>()</td><td><a class="el" href="classField.html">Field</a></td><td><code> [protected, virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classListField.html#aab8477757cd89bacd242c85bac2dccb1">value</a>() const </td><td><a class="el" href="classListField.html">ListField</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#a45d6e6d09b8f8e46de62b40119d62c60">~Field</a>()</td><td><a class="el" href="classField.html">Field</a></td><td></td></tr>
</table></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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

329
classListField.html Normal file
View File

@ -0,0 +1,329 @@
<!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"/>
<title>ArduinoLibs: ListField Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> </div>
<div class="headertitle">
<div class="title">ListField Class Reference</div> </div>
</div>
<div class="contents">
<!-- doxytag: class="ListField" --><!-- doxytag: inherits="Field" -->
<p><a class="el" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> that manages selection from a static list of items.
<a href="classListField.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="ListField_8h_source.html">ListField.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for ListField:</div>
<div class="dyncontent">
<div class="center">
<img src="classListField.png" usemap="#ListField_map" alt=""/>
<map id="ListField_map" name="ListField_map">
<area href="classField.html" title="Manages a single data input/output field within a Form." alt="Field" shape="rect" coords="0,0,59,24"/>
</map>
</div></div>
<p><a href="classListField-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classListField.html#a118501da7edb0b0bc6b493734975b4e9">ListField</a> (const String &amp;label)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new list field with a specific <em>label</em>. <a href="#a118501da7edb0b0bc6b493734975b4e9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa303898a1f74b52c1c4982653de488b7"></a><!-- doxytag: member="ListField::ListField" ref="aa303898a1f74b52c1c4982653de488b7" args="(Form &amp;form, const String &amp;label, ListItems items, int value=0)" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classListField.html#aa303898a1f74b52c1c4982653de488b7">ListField</a> (<a class="el" href="classForm.html">Form</a> &amp;form, const String &amp;label, ListItems items, int value=0)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new list field with a specific <em>label</em>, list of <em>items</em>, and <em>value</em>, and attaches it to a <em>form</em>. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classListField.html#a5d752bd561cde735b175bcdfda55832a">dispatch</a> (int event)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Dispatches <em>event</em> via this field. <a href="#a5d752bd561cde735b175bcdfda55832a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classListField.html#a191b79b460e45cf48e04b04eface2888">enterField</a> (bool reverse)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Enters the field due to form navigation. <a href="#a191b79b460e45cf48e04b04eface2888"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">ListItems&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classListField.html#a4dbbdeebd386551eb8f245b42b45ccf0">items</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the array of items in this list. <a href="#a4dbbdeebd386551eb8f245b42b45ccf0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classListField.html#ae6709bce9355451b651893691456704e">setItems</a> (ListItems items)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the array of <em>items</em> for this list. <a href="#ae6709bce9355451b651893691456704e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classListField.html#aab8477757cd89bacd242c85bac2dccb1">value</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the value of this list; i.e. the index within <a class="el" href="classListField.html#a4dbbdeebd386551eb8f245b42b45ccf0" title="Returns the array of items in this list.">items()</a> of the selected item. <a href="#aab8477757cd89bacd242c85bac2dccb1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classListField.html#a266193631e897fb0b46e1270b1d0eb24">setValue</a> (int value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the <em>value</em> of this list; i.e. the index within <a class="el" href="classListField.html#a4dbbdeebd386551eb8f245b42b45ccf0" title="Returns the array of items in this list.">items()</a> of the selected item. <a href="#a266193631e897fb0b46e1270b1d0eb24"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p><a class="el" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> that manages selection from a static list of items. </p>
<p><a class="el" href="classListField.html" title="Field that manages selection from a static list of items.">ListField</a> is intended for selecting an element from a list of items. Each items is represented by a string within program memory, with the list terminated by null. For example:</p>
<div class="fragment"><pre class="fragment"> <span class="keyword">const</span> <span class="keywordtype">char</span> item_Eggs[] PROGMEM = <span class="stringliteral">&quot;Eggs&quot;</span>;
<span class="keyword">const</span> <span class="keywordtype">char</span> item_Cheese[] PROGMEM = <span class="stringliteral">&quot;Cheese&quot;</span>;
<span class="keyword">const</span> <span class="keywordtype">char</span> item_Pumpkin[] PROGMEM = <span class="stringliteral">&quot;Pumpkin&quot;</span>;
ListItem <span class="keyword">const</span> ingredients[] PROGMEM = {
item_Eggs,
item_Cheese,
item_Pumpkin,
0
};
<a class="code" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> mainForm(lcd);
<a class="code" href="classListField.html" title="Field that manages selection from a static list of items.">ListField</a> ingredient(mainForm, <span class="stringliteral">&quot;Select ingredient&quot;</span>, ingredients);
</pre></div><p>If there are only two items in the list, then <a class="el" href="classBoolField.html" title="Field that manages the input of a boolean value.">BoolField</a> can be used instead.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a>, <a class="el" href="classBoolField.html" title="Field that manages the input of a boolean value.">BoolField</a> </dd></dl>
<p>Definition at line <a class="el" href="ListField_8h_source.html#l00032">32</a> of file <a class="el" href="ListField_8h_source.html">ListField.h</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a118501da7edb0b0bc6b493734975b4e9"></a><!-- doxytag: member="ListField::ListField" ref="a118501da7edb0b0bc6b493734975b4e9" args="(const String &amp;label)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ListField::ListField </td>
<td>(</td>
<td class="paramtype">const String &amp;&#160;</td>
<td class="paramname"><em>label</em></td><td>)</td>
<td><code> [explicit]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs a new list field with a specific <em>label</em>. </p>
<p>The field is initially not associated with a <a class="el" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a>. The field can be added to a form later using <a class="el" href="classForm.html#a5cb056ace428e75e321610555bfecac7" title="Adds field to this form.">Form::addField()</a>.</p>
<p>Initially, <a class="el" href="classListField.html#a4dbbdeebd386551eb8f245b42b45ccf0" title="Returns the array of items in this list.">items()</a> is null and <a class="el" href="classListField.html#aab8477757cd89bacd242c85bac2dccb1" title="Returns the value of this list; i.e. the index within items() of the selected item.">value()</a> is -1.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classForm.html#a5cb056ace428e75e321610555bfecac7" title="Adds field to this form.">Form::addField()</a> </dd></dl>
<p>Definition at line <a class="el" href="ListField_8cpp_source.html#l00064">64</a> of file <a class="el" href="ListField_8cpp_source.html">ListField.cpp</a>.</p>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a5d752bd561cde735b175bcdfda55832a"></a><!-- doxytag: member="ListField::dispatch" ref="a5d752bd561cde735b175bcdfda55832a" args="(int event)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int ListField::dispatch </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>event</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Dispatches <em>event</em> via this field. </p>
<p>The <em>event</em> is usually obtained from <a class="el" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292" title="Gets the next button press, release, or idle event.">LCD::getButton()</a>.</p>
<p>Returns zero if the <em>event</em> has been handled and no further action is required.</p>
<p>Returns FORM_CHANGED if the <em>event</em> has changed the value of this field in a manner that may require the application to take further action based on the new field value.</p>
<p>Returns -1 if the <em>event</em> is not handled by this field, and should be handled by the <a class="el" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> itself (particularly for Left and Right buttons). The default implementation returns -1 for all events.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classForm.html#a89bd3850e87caa2ca7b2e946f923d0ee" title="Dispatches event to the currently active field using Field::dispatch().">Form::dispatch()</a>, <a class="el" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292" title="Gets the next button press, release, or idle event.">LCD::getButton()</a> </dd></dl>
<p>Reimplemented from <a class="el" href="classField.html#a061bd1ed4d8b079df86465df8facd3b3">Field</a>.</p>
<p>Definition at line <a class="el" href="ListField_8cpp_source.html#l00087">87</a> of file <a class="el" href="ListField_8cpp_source.html">ListField.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a191b79b460e45cf48e04b04eface2888"></a><!-- doxytag: member="ListField::enterField" ref="a191b79b460e45cf48e04b04eface2888" args="(bool reverse)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ListField::enterField </td>
<td>(</td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>reverse</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Enters the field due to form navigation. </p>
<p>This function is typically called when the user presses Left and Right buttons to navigate to the field. If <em>reverse</em> is true, then navigation was due to the Left button being pressed.</p>
<p>This function can assume that the display has been cleared and the cursor is positioned at (0, 0).</p>
<p>The default implementation prints the <a class="el" href="classField.html#aaa861ef917130c989a955bc75c683afe" title="Returns the label to display in the first line of this field.">label()</a>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classField.html#ad6805c75ee1e62f8cd8bd550c4530c07" title="Exits the field due to form navigation.">exitField()</a> </dd></dl>
<p>Reimplemented from <a class="el" href="classField.html#aa032bbeacb405c56546cb56fbbee94f5">Field</a>.</p>
<p>Definition at line <a class="el" href="ListField_8cpp_source.html#l00105">105</a> of file <a class="el" href="ListField_8cpp_source.html">ListField.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a4dbbdeebd386551eb8f245b42b45ccf0"></a><!-- doxytag: member="ListField::items" ref="a4dbbdeebd386551eb8f245b42b45ccf0" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ListItems ListField::items </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the array of items in this list. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classListField.html#ae6709bce9355451b651893691456704e" title="Sets the array of items for this list.">setItems()</a> </dd></dl>
<p>Definition at line <a class="el" href="ListField_8h_source.html#l00041">41</a> of file <a class="el" href="ListField_8h_source.html">ListField.h</a>.</p>
</div>
</div>
<a class="anchor" id="ae6709bce9355451b651893691456704e"></a><!-- doxytag: member="ListField::setItems" ref="ae6709bce9355451b651893691456704e" args="(ListItems items)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ListField::setItems </td>
<td>(</td>
<td class="paramtype">ListItems&#160;</td>
<td class="paramname"><em>items</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the array of <em>items</em> for this list. </p>
<p>The <em>items</em> must be stored within program memory and terminated by null; for example:</p>
<div class="fragment"><pre class="fragment"> <span class="keyword">const</span> <span class="keywordtype">char</span> item_Eggs[] PROGMEM = <span class="stringliteral">&quot;Eggs&quot;</span>;
<span class="keyword">const</span> <span class="keywordtype">char</span> item_Cheese[] PROGMEM = <span class="stringliteral">&quot;Cheese&quot;</span>;
<span class="keyword">const</span> <span class="keywordtype">char</span> item_Pumpkin[] PROGMEM = <span class="stringliteral">&quot;Pumpkin&quot;</span>;
ListItem <span class="keyword">const</span> ingredients[] PROGMEM = {
item_Eggs,
item_Cheese,
item_Pumpkin,
0
};
list.setItems(ingredients);
</pre></div><dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classListField.html#a4dbbdeebd386551eb8f245b42b45ccf0" title="Returns the array of items in this list.">items()</a> </dd></dl>
<p>Definition at line <a class="el" href="ListField_8cpp_source.html#l00141">141</a> of file <a class="el" href="ListField_8cpp_source.html">ListField.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a266193631e897fb0b46e1270b1d0eb24"></a><!-- doxytag: member="ListField::setValue" ref="a266193631e897fb0b46e1270b1d0eb24" args="(int value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ListField::setValue </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the <em>value</em> of this list; i.e. the index within <a class="el" href="classListField.html#a4dbbdeebd386551eb8f245b42b45ccf0" title="Returns the array of items in this list.">items()</a> of the selected item. </p>
<p>The <em>value</em> will be clamped to the range of <a class="el" href="classListField.html#a4dbbdeebd386551eb8f245b42b45ccf0" title="Returns the array of items in this list.">items()</a>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classListField.html#aab8477757cd89bacd242c85bac2dccb1" title="Returns the value of this list; i.e. the index within items() of the selected item.">value()</a>, <a class="el" href="classListField.html#a4dbbdeebd386551eb8f245b42b45ccf0" title="Returns the array of items in this list.">items()</a> </dd></dl>
<p>Definition at line <a class="el" href="ListField_8cpp_source.html#l00178">178</a> of file <a class="el" href="ListField_8cpp_source.html">ListField.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aab8477757cd89bacd242c85bac2dccb1"></a><!-- doxytag: member="ListField::value" ref="aab8477757cd89bacd242c85bac2dccb1" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int ListField::value </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the value of this list; i.e. the index within <a class="el" href="classListField.html#a4dbbdeebd386551eb8f245b42b45ccf0" title="Returns the array of items in this list.">items()</a> of the selected item. </p>
<p>Returns -1 if the <a class="el" href="classListField.html#a4dbbdeebd386551eb8f245b42b45ccf0" title="Returns the array of items in this list.">items()</a> array is empty or null.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classListField.html#a266193631e897fb0b46e1270b1d0eb24" title="Sets the value of this list; i.e. the index within items() of the selected item.">setValue()</a>, <a class="el" href="classListField.html#a4dbbdeebd386551eb8f245b42b45ccf0" title="Returns the array of items in this list.">items()</a> </dd></dl>
<p>Definition at line <a class="el" href="ListField_8h_source.html#l00044">44</a> of file <a class="el" href="ListField_8h_source.html">ListField.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="ListField_8h_source.html">ListField.h</a></li>
<li><a class="el" href="ListField_8cpp_source.html">ListField.cpp</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

BIN
classListField.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

97
classMelody-members.html Normal file
View File

@ -0,0 +1,97 @@
<!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"/>
<title>ArduinoLibs: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">Melody Member List</div> </div>
</div>
<div class="contents">
This is the complete list of members for <a class="el" href="classMelody.html">Melody</a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="classMelody.html#ad38db3338ed87d72238c0ea9440c633c">isPlaying</a>() const </td><td><a class="el" href="classMelody.html">Melody</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classMelody.html#ab78253ae9abc8478b05f415f5d878a60">loopCount</a>() const </td><td><a class="el" href="classMelody.html">Melody</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classMelody.html#a9edc4165a49368dd5d78eedf982c38b9">Melody</a>(uint8_t pin)</td><td><a class="el" href="classMelody.html">Melody</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classMelody.html#a9fd8e0d48833d8da3cd3b3b58408b0b5">play</a>()</td><td><a class="el" href="classMelody.html">Melody</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classMelody.html#aecc9185c9cb1246e8a55521b17d72932">playOnce</a>()</td><td><a class="el" href="classMelody.html">Melody</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classMelody.html#ad1103b970be1f59058cc7d927be68955">run</a>()</td><td><a class="el" href="classMelody.html">Melody</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classMelody.html#a507097a2e8ff51a5e9157e3a320ae35b">setLoopCount</a>(int count)</td><td><a class="el" href="classMelody.html">Melody</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classMelody.html#ae88ad06c2acb728f56dd213d5dad6006">setLoopDuration</a>(unsigned long ms)</td><td><a class="el" href="classMelody.html">Melody</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classMelody.html#adb6ad8e8cfe8c9a137e470f4e85c7254">setMelody</a>(const int *notes, const uint8_t *lengths, unsigned int size)</td><td><a class="el" href="classMelody.html">Melody</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classMelody.html#ac0c552233c41d85f2766d2e4df376b2b">stop</a>()</td><td><a class="el" href="classMelody.html">Melody</a></td><td></td></tr>
</table></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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

350
classMelody.html Normal file
View File

@ -0,0 +1,350 @@
<!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"/>
<title>ArduinoLibs: Melody Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> </div>
<div class="headertitle">
<div class="title">Melody Class Reference</div> </div>
</div>
<div class="contents">
<!-- doxytag: class="Melody" -->
<p>Plays a melody on a digital output pin using tone().
<a href="classMelody.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="Melody_8h_source.html">Melody.h</a>&gt;</code></p>
<p><a href="classMelody-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9edc4165a49368dd5d78eedf982c38b9"></a><!-- doxytag: member="Melody::Melody" ref="a9edc4165a49368dd5d78eedf982c38b9" args="(uint8_t pin)" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMelody.html#a9edc4165a49368dd5d78eedf982c38b9">Melody</a> (uint8_t pin)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new melody playing object for <em>pin</em>. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad38db3338ed87d72238c0ea9440c633c"></a><!-- doxytag: member="Melody::isPlaying" ref="ad38db3338ed87d72238c0ea9440c633c" args="() const " -->
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMelody.html#ad38db3338ed87d72238c0ea9440c633c">isPlaying</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the melody is currently playing; false if not. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMelody.html#ab78253ae9abc8478b05f415f5d878a60">loopCount</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of times the melody should loop before stopping. <a href="#ab78253ae9abc8478b05f415f5d878a60"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMelody.html#a507097a2e8ff51a5e9157e3a320ae35b">setLoopCount</a> (int count)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the number of times the melody should loop to <em>count</em>. <a href="#a507097a2e8ff51a5e9157e3a320ae35b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMelody.html#ae88ad06c2acb728f56dd213d5dad6006">setLoopDuration</a> (unsigned long ms)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the maximum number of loops to last no longer than <em>ms</em> milliseconds. <a href="#ae88ad06c2acb728f56dd213d5dad6006"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMelody.html#a9fd8e0d48833d8da3cd3b3b58408b0b5">play</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Starts playing the melody, or restarts it if already playing. <a href="#a9fd8e0d48833d8da3cd3b3b58408b0b5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMelody.html#aecc9185c9cb1246e8a55521b17d72932">playOnce</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Plays the melody once and then stops. <a href="#aecc9185c9cb1246e8a55521b17d72932"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMelody.html#ac0c552233c41d85f2766d2e4df376b2b">stop</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Stops playing the melody. <a href="#ac0c552233c41d85f2766d2e4df376b2b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMelody.html#adb6ad8e8cfe8c9a137e470f4e85c7254">setMelody</a> (const int *notes, const uint8_t *lengths, unsigned int size)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the melody to the <em>size</em> elements of <em>notes</em> and <em>lengths</em>. <a href="#adb6ad8e8cfe8c9a137e470f4e85c7254"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMelody.html#ad1103b970be1f59058cc7d927be68955">run</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Runs the melody control loop. <a href="#ad1103b970be1f59058cc7d927be68955"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Plays a melody on a digital output pin using tone(). </p>
<p>The following example plays a simple tone three times on digital pin 8:</p>
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include &lt;Melody.h&gt;</span>
<span class="keywordtype">int</span> notes[] = {
NOTE_C4, NOTE_G3, NOTE_G3, NOTE_A3, NOTE_G3,
NOTE_REST, NOTE_B3, NOTE_C4, NOTE_REST
};
byte lengths[] = {4, 8, 8, 4, 4, 4, 4, 4, 2};
<a class="code" href="classMelody.html" title="Plays a melody on a digital output pin using tone().">Melody</a> melody(8);
<span class="keywordtype">void</span> setup() {
melody.setMelody(notes, lengths, <span class="keyword">sizeof</span>(lengths));
melody.setLoopCount(3);
melody.play();
}
<span class="keywordtype">void</span> loop() {
melody.run();
}
</pre></div><p>The <code>notes</code> array contains the frequency of the notes to be played, with the special value <code>NOTE_REST</code> indicating a rest where no notes are playing. The <code>lengths</code> array contains the lengths of each of the notes; a value of 4 indicates a quarter note, a value of 8 indicates an eighth note, etc.</p>
<p>The <a class="el" href="classMelody.html#ad1103b970be1f59058cc7d927be68955" title="Runs the melody control loop.">run()</a> method must be called from the application's main <code>loop()</code> method to ensure that the melody advances from one note to the next. It will not block the application while notes are playing.</p>
<p>The number of loops can also be specified with <a class="el" href="classMelody.html#ae88ad06c2acb728f56dd213d5dad6006" title="Sets the maximum number of loops to last no longer than ms milliseconds.">setLoopDuration()</a> which sets a maximum amount of time that the melody will play before stopping. The following example plays the melody for no more than 60 seconds:</p>
<div class="fragment"><pre class="fragment"> <span class="keywordtype">void</span> setup() {
melody.setMelody(notes, lengths, <span class="keyword">sizeof</span>(lengths));
melody.setLoopDuration(60000UL);
melody.play();
}
</pre></div>
<p>Definition at line <a class="el" href="Melody_8h_source.html#l00122">122</a> of file <a class="el" href="Melody_8h_source.html">Melody.h</a>.</p>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ab78253ae9abc8478b05f415f5d878a60"></a><!-- doxytag: member="Melody::loopCount" ref="ab78253ae9abc8478b05f415f5d878a60" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int Melody::loopCount </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the number of times the melody should loop before stopping. </p>
<p>The default value is zero, indicating that the melody will loop indefinitely.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classMelody.html#a507097a2e8ff51a5e9157e3a320ae35b" title="Sets the number of times the melody should loop to count.">setLoopCount()</a>, <a class="el" href="classMelody.html#ae88ad06c2acb728f56dd213d5dad6006" title="Sets the maximum number of loops to last no longer than ms milliseconds.">setLoopDuration()</a>, <a class="el" href="classMelody.html#a9fd8e0d48833d8da3cd3b3b58408b0b5" title="Starts playing the melody, or restarts it if already playing.">play()</a> </dd></dl>
<p>Definition at line <a class="el" href="Melody_8h_source.html#l00128">128</a> of file <a class="el" href="Melody_8h_source.html">Melody.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9fd8e0d48833d8da3cd3b3b58408b0b5"></a><!-- doxytag: member="Melody::play" ref="a9fd8e0d48833d8da3cd3b3b58408b0b5" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Melody::play </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Starts playing the melody, or restarts it if already playing. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classMelody.html#aecc9185c9cb1246e8a55521b17d72932" title="Plays the melody once and then stops.">playOnce()</a>, <a class="el" href="classMelody.html#adb6ad8e8cfe8c9a137e470f4e85c7254" title="Sets the melody to the size elements of notes and lengths.">setMelody()</a>, <a class="el" href="classMelody.html#ac0c552233c41d85f2766d2e4df376b2b" title="Stops playing the melody.">stop()</a>, <a class="el" href="classMelody.html#ab78253ae9abc8478b05f415f5d878a60" title="Returns the number of times the melody should loop before stopping.">loopCount()</a> </dd></dl>
<p>Definition at line <a class="el" href="Melody_8cpp_source.html#l00146">146</a> of file <a class="el" href="Melody_8cpp_source.html">Melody.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aecc9185c9cb1246e8a55521b17d72932"></a><!-- doxytag: member="Melody::playOnce" ref="aecc9185c9cb1246e8a55521b17d72932" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Melody::playOnce </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Plays the melody once and then stops. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classMelody.html#a9fd8e0d48833d8da3cd3b3b58408b0b5" title="Starts playing the melody, or restarts it if already playing.">play()</a>, <a class="el" href="classMelody.html#ac0c552233c41d85f2766d2e4df376b2b" title="Stops playing the melody.">stop()</a> </dd></dl>
<p>Definition at line <a class="el" href="Melody_8cpp_source.html#l00162">162</a> of file <a class="el" href="Melody_8cpp_source.html">Melody.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ad1103b970be1f59058cc7d927be68955"></a><!-- doxytag: member="Melody::run" ref="ad1103b970be1f59058cc7d927be68955" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Melody::run </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Runs the melody control loop. </p>
<p>This function must be called by the application's main <code>loop()</code> function to cause the melody to advance from note to note. It will not block the application while notes are playing. </p>
<p>Definition at line <a class="el" href="Melody_8cpp_source.html#l00214">214</a> of file <a class="el" href="Melody_8cpp_source.html">Melody.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a507097a2e8ff51a5e9157e3a320ae35b"></a><!-- doxytag: member="Melody::setLoopCount" ref="a507097a2e8ff51a5e9157e3a320ae35b" args="(int count)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Melody::setLoopCount </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>count</em></td><td>)</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the number of times the melody should loop to <em>count</em>. </p>
<p>If <em>count</em> is zero, then the melody will loop indefinitely.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classMelody.html#ab78253ae9abc8478b05f415f5d878a60" title="Returns the number of times the melody should loop before stopping.">loopCount()</a>, <a class="el" href="classMelody.html#ae88ad06c2acb728f56dd213d5dad6006" title="Sets the maximum number of loops to last no longer than ms milliseconds.">setLoopDuration()</a> </dd></dl>
<p>Definition at line <a class="el" href="Melody_8h_source.html#l00129">129</a> of file <a class="el" href="Melody_8h_source.html">Melody.h</a>.</p>
</div>
</div>
<a class="anchor" id="ae88ad06c2acb728f56dd213d5dad6006"></a><!-- doxytag: member="Melody::setLoopDuration" ref="ae88ad06c2acb728f56dd213d5dad6006" args="(unsigned long ms)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Melody::setLoopDuration </td>
<td>(</td>
<td class="paramtype">unsigned long&#160;</td>
<td class="paramname"><em>ms</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the maximum number of loops to last no longer than <em>ms</em> milliseconds. </p>
<p>This function must be called after the melody is specified with <a class="el" href="classMelody.html#adb6ad8e8cfe8c9a137e470f4e85c7254" title="Sets the melody to the size elements of notes and lengths.">setMelody()</a> as it uses the length of the melody and <em>ms</em> to determine the <a class="el" href="classMelody.html#ab78253ae9abc8478b05f415f5d878a60" title="Returns the number of times the melody should loop before stopping.">loopCount()</a>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classMelody.html#ab78253ae9abc8478b05f415f5d878a60" title="Returns the number of times the melody should loop before stopping.">loopCount()</a>, <a class="el" href="classMelody.html#a507097a2e8ff51a5e9157e3a320ae35b" title="Sets the number of times the melody should loop to count.">setLoopCount()</a> </dd></dl>
<p>Definition at line <a class="el" href="Melody_8cpp_source.html#l00131">131</a> of file <a class="el" href="Melody_8cpp_source.html">Melody.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="adb6ad8e8cfe8c9a137e470f4e85c7254"></a><!-- doxytag: member="Melody::setMelody" ref="adb6ad8e8cfe8c9a137e470f4e85c7254" args="(const int *notes, const uint8_t *lengths, unsigned int size)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Melody::setMelody </td>
<td>(</td>
<td class="paramtype">const int *&#160;</td>
<td class="paramname"><em>notes</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const uint8_t *&#160;</td>
<td class="paramname"><em>lengths</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int&#160;</td>
<td class="paramname"><em>size</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the melody to the <em>size</em> elements of <em>notes</em> and <em>lengths</em>. </p>
<p>If a melody is currently playing, then this function will stop playback.</p>
<p>The <em>notes</em> array contains the frequency of the notes to be played, with the special value <code>NOTE_REST</code> indicating a rest where no notes are playing. The <em>lengths</em> array contains the lengths of each of the notes; a value of 4 indicates a quarter note, a value of 8 indicates an eighth note, etc.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classMelody.html#a9fd8e0d48833d8da3cd3b3b58408b0b5" title="Starts playing the melody, or restarts it if already playing.">play()</a> </dd></dl>
<p>Definition at line <a class="el" href="Melody_8cpp_source.html#l00199">199</a> of file <a class="el" href="Melody_8cpp_source.html">Melody.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ac0c552233c41d85f2766d2e4df376b2b"></a><!-- doxytag: member="Melody::stop" ref="ac0c552233c41d85f2766d2e4df376b2b" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Melody::stop </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Stops playing the melody. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classMelody.html#a9fd8e0d48833d8da3cd3b3b58408b0b5" title="Starts playing the melody, or restarts it if already playing.">play()</a> </dd></dl>
<p>Definition at line <a class="el" href="Melody_8cpp_source.html#l00178">178</a> of file <a class="el" href="Melody_8cpp_source.html">Melody.cpp</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="Melody_8h_source.html">Melody.h</a></li>
<li><a class="el" href="Melody_8cpp_source.html">Melody.cpp</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

106
classRTC-members.html Normal file
View File

@ -0,0 +1,106 @@
<!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"/>
<title>ArduinoLibs: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">RTC Member List</div> </div>
</div>
<div class="contents">
This is the complete list of members for <a class="el" href="classRTC.html">RTC</a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="classRTC.html#adc29d7c43efc5a192d21965da5c3ee1d">adjustDays</a>(RTCDate *date, uint8_t flags)</td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [static]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#aeca597e6e37a05716e664242f9cfc5f4">adjustMonths</a>(RTCDate *date, uint8_t flags)</td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [static]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#a31d10cb2f7cac8839bd4be2d858b802d">adjustYears</a>(RTCDate *date, uint8_t flags)</td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [static]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#aee5ae8f600ee5296e65635c0d836fca3">ALARM_COUNT</a></td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [static]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#acfdebfb449710e44e11f9a3675e14fd8">byteCount</a>() const </td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#a05b1bd1479afc80682abdd4f3e58dc6f">DECREMENT</a></td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [static]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#a3690761f29654a2c9e676fcbfa32dd30">hasUpdates</a>()</td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#aacbe3ebbf893685950b05327c11d5c37">INCREMENT</a></td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [static]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#ade282d7a60147c3f0269f1fcd59c8d66">readAlarm</a>(uint8_t alarmNum, RTCAlarm *value)</td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#a0f47b10b436e3f9d36e04ec907579431">readByte</a>(uint8_t offset)</td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#aa1e21bf42ebd4456919744ae0f4f631e">readDate</a>(RTCDate *value)</td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#aaf0a5c1f32f210a49718d148620b5bec">readTime</a>(RTCTime *value)</td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#ada31c5120d18d2dd2863b3d440308da2">RTC</a>()</td><td><a class="el" href="classRTC.html">RTC</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#a02ace2d775063be9a99035851c9274eb">WRAP</a></td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [static]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#a0e96c91efd9e7a6340effdae3eadf17e">writeAlarm</a>(uint8_t alarmNum, const RTCAlarm *value)</td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#a1cab6397ec04b1e2b3feea5b3cd1f749">writeByte</a>(uint8_t offset, uint8_t value)</td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#ae667600d05c8e7b06a93574dd068a4d7">writeDate</a>(const RTCDate *value)</td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRTC.html#a102e2ec15bf0273d8f7e9ce4b6dcc96e">writeTime</a>(const RTCTime *value)</td><td><a class="el" href="classRTC.html">RTC</a></td><td><code> [virtual]</code></td></tr>
<tr bgcolor="#f0f0f0"><td><b>~RTC</b>() (defined in <a class="el" href="classRTC.html">RTC</a>)</td><td><a class="el" href="classRTC.html">RTC</a></td><td></td></tr>
</table></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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

561
classRTC.html Normal file
View File

@ -0,0 +1,561 @@
<!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"/>
<title>ArduinoLibs: RTC Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> </div>
<div class="headertitle">
<div class="title">RTC Class Reference</div> </div>
</div>
<div class="contents">
<!-- doxytag: class="RTC" -->
<p>Base class for realtime clock handlers.
<a href="classRTC.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="RTC_8h_source.html">RTC.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for RTC:</div>
<div class="dyncontent">
<div class="center">
<img src="classRTC.png" usemap="#RTC_map" alt=""/>
<map id="RTC_map" name="RTC_map">
<area href="classDS1307RTC.html" title="Communicates with a DS1307 realtime clock chip via I2C." alt="DS1307RTC" shape="rect" coords="0,56,81,80"/>
<area href="classDS3232RTC.html" title="Communicates with a DS3232 realtime clock chip via I2C." alt="DS3232RTC" shape="rect" coords="91,56,172,80"/>
</map>
</div></div>
<p><a href="classRTC-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRTC.html#ada31c5120d18d2dd2863b3d440308da2">RTC</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new realtime clock handler. <a href="#ada31c5120d18d2dd2863b3d440308da2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRTC.html#a3690761f29654a2c9e676fcbfa32dd30">hasUpdates</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the realtime clock has updated since the last call to this function. <a href="#a3690761f29654a2c9e676fcbfa32dd30"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRTC.html#aaf0a5c1f32f210a49718d148620b5bec">readTime</a> (<a class="el" href="structRTCTime.html">RTCTime</a> *value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the current time from the realtime clock into <em>value</em>. <a href="#aaf0a5c1f32f210a49718d148620b5bec"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRTC.html#aa1e21bf42ebd4456919744ae0f4f631e">readDate</a> (<a class="el" href="structRTCDate.html">RTCDate</a> *value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the current date from the realtime clock into <em>value</em>. <a href="#aa1e21bf42ebd4456919744ae0f4f631e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRTC.html#a102e2ec15bf0273d8f7e9ce4b6dcc96e">writeTime</a> (const <a class="el" href="structRTCTime.html">RTCTime</a> *value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the time in the realtime clock to match <em>value</em>. <a href="#a102e2ec15bf0273d8f7e9ce4b6dcc96e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRTC.html#ae667600d05c8e7b06a93574dd068a4d7">writeDate</a> (const <a class="el" href="structRTCDate.html">RTCDate</a> *value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the date in the realtime clock to match <em>value</em>. <a href="#ae667600d05c8e7b06a93574dd068a4d7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRTC.html#ade282d7a60147c3f0269f1fcd59c8d66">readAlarm</a> (uint8_t alarmNum, <a class="el" href="structRTCAlarm.html">RTCAlarm</a> *value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the details of the alarm with index <em>alarmNum</em> into <em>value</em>. <a href="#ade282d7a60147c3f0269f1fcd59c8d66"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRTC.html#a0e96c91efd9e7a6340effdae3eadf17e">writeAlarm</a> (uint8_t alarmNum, const <a class="el" href="structRTCAlarm.html">RTCAlarm</a> *value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the details of the alarm with index <em>alarmNum</em> from <em>value</em>. <a href="#a0e96c91efd9e7a6340effdae3eadf17e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRTC.html#acfdebfb449710e44e11f9a3675e14fd8">byteCount</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings, excluding storage used by alarms. <a href="#acfdebfb449710e44e11f9a3675e14fd8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRTC.html#a0f47b10b436e3f9d36e04ec907579431">readByte</a> (uint8_t offset)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the byte at <em>offset</em> within the realtime clock's non-volatile memory. <a href="#a0f47b10b436e3f9d36e04ec907579431"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRTC.html#a1cab6397ec04b1e2b3feea5b3cd1f749">writeByte</a> (uint8_t offset, uint8_t value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes <em>value</em> to <em>offset</em> within the realtime clock's non-volatile memory. <a href="#a1cab6397ec04b1e2b3feea5b3cd1f749"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRTC.html#adc29d7c43efc5a192d21965da5c3ee1d">adjustDays</a> (<a class="el" href="structRTCDate.html">RTCDate</a> *date, uint8_t flags)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Adjusts <em>date</em> up or down one day according to <em>flags</em>. <a href="#adc29d7c43efc5a192d21965da5c3ee1d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRTC.html#aeca597e6e37a05716e664242f9cfc5f4">adjustMonths</a> (<a class="el" href="structRTCDate.html">RTCDate</a> *date, uint8_t flags)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Adjusts <em>date</em> up or down one month according to <em>flags</em>. <a href="#aeca597e6e37a05716e664242f9cfc5f4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRTC.html#a31d10cb2f7cac8839bd4be2d858b802d">adjustYears</a> (<a class="el" href="structRTCDate.html">RTCDate</a> *date, uint8_t flags)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Adjusts <em>date</em> up or down one year according to <em>flags</em>. <a href="#a31d10cb2f7cac8839bd4be2d858b802d"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aee5ae8f600ee5296e65635c0d836fca3"></a><!-- doxytag: member="RTC::ALARM_COUNT" ref="aee5ae8f600ee5296e65635c0d836fca3" args="" -->
static const uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRTC.html#aee5ae8f600ee5296e65635c0d836fca3">ALARM_COUNT</a> = 4</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Number of alarms that are supported by <a class="el" href="classRTC.html#ade282d7a60147c3f0269f1fcd59c8d66" title="Reads the details of the alarm with index alarmNum into value.">RTC::readAlarm()</a> and <a class="el" href="classRTC.html#a0e96c91efd9e7a6340effdae3eadf17e" title="Updates the details of the alarm with index alarmNum from value.">RTC::writeAlarm()</a>. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aacbe3ebbf893685950b05327c11d5c37"></a><!-- doxytag: member="RTC::INCREMENT" ref="aacbe3ebbf893685950b05327c11d5c37" args="" -->
static const uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRTC.html#aacbe3ebbf893685950b05327c11d5c37">INCREMENT</a> = 0x0000</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Increment the day, month, or year in a call to <a class="el" href="classRTC.html#adc29d7c43efc5a192d21965da5c3ee1d" title="Adjusts date up or down one day according to flags.">adjustDays()</a>, <a class="el" href="classRTC.html#aeca597e6e37a05716e664242f9cfc5f4" title="Adjusts date up or down one month according to flags.">adjustMonths()</a>, or <a class="el" href="classRTC.html#a31d10cb2f7cac8839bd4be2d858b802d" title="Adjusts date up or down one year according to flags.">adjustYears()</a>. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a05b1bd1479afc80682abdd4f3e58dc6f"></a><!-- doxytag: member="RTC::DECREMENT" ref="a05b1bd1479afc80682abdd4f3e58dc6f" args="" -->
static const uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRTC.html#a05b1bd1479afc80682abdd4f3e58dc6f">DECREMENT</a> = 0x0001</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Decrement the day, month, or year in a call to <a class="el" href="classRTC.html#adc29d7c43efc5a192d21965da5c3ee1d" title="Adjusts date up or down one day according to flags.">adjustDays()</a>, <a class="el" href="classRTC.html#aeca597e6e37a05716e664242f9cfc5f4" title="Adjusts date up or down one month according to flags.">adjustMonths()</a>, or <a class="el" href="classRTC.html#a31d10cb2f7cac8839bd4be2d858b802d" title="Adjusts date up or down one year according to flags.">adjustYears()</a>. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a02ace2d775063be9a99035851c9274eb"></a><!-- doxytag: member="RTC::WRAP" ref="a02ace2d775063be9a99035851c9274eb" args="" -->
static const uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRTC.html#a02ace2d775063be9a99035851c9274eb">WRAP</a> = 0x0002</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Wrap around to the beginning of the current month/year rather than advance to the next one. <br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Base class for realtime clock handlers. </p>
<p>This class simplifies the process of reading and writing the time and date information in a realtime clock chip. The class also provides support for reading and writing information about alarms and other clock settings.</p>
<p>It is intended that the application will instantiate a subclass of this class to handle the specific realtime clock chip in the system. The default implementation in <a class="el" href="classRTC.html" title="Base class for realtime clock handlers.">RTC</a> simulates a clock based on the value of millis(), with alarms and clock settings stored in main memory.</p>
<p>Because the common DS1307 and DS3232 realtime clock chips use a 2-digit year, this class is also limited to dates between 2000 and 2099 inclusive.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="structRTCTime.html" title="Stores time information from a realtime clock chip.">RTCTime</a>, <a class="el" href="structRTCDate.html" title="Stores date information from a realtime clock chip.">RTCDate</a>, <a class="el" href="structRTCAlarm.html" title="Stores alarm information from a realtime clock chip.">RTCAlarm</a>, <a class="el" href="classDS1307RTC.html" title="Communicates with a DS1307 realtime clock chip via I2C.">DS1307RTC</a>, <a class="el" href="classDS3232RTC.html" title="Communicates with a DS3232 realtime clock chip via I2C.">DS3232RTC</a> </dd></dl>
<p>Definition at line <a class="el" href="RTC_8h_source.html#l00049">49</a> of file <a class="el" href="RTC_8h_source.html">RTC.h</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ada31c5120d18d2dd2863b3d440308da2"></a><!-- doxytag: member="RTC::RTC" ref="ada31c5120d18d2dd2863b3d440308da2" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">RTC::RTC </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs a new realtime clock handler. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classRTC.html#a3690761f29654a2c9e676fcbfa32dd30" title="Returns true if the realtime clock has updated since the last call to this function.">hasUpdates()</a> </dd></dl>
<p>Definition at line <a class="el" href="RTC_8cpp_source.html#l00090">90</a> of file <a class="el" href="RTC_8cpp_source.html">RTC.cpp</a>.</p>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="adc29d7c43efc5a192d21965da5c3ee1d"></a><!-- doxytag: member="RTC::adjustDays" ref="adc29d7c43efc5a192d21965da5c3ee1d" args="(RTCDate *date, uint8_t flags)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void RTC::adjustDays </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structRTCDate.html">RTCDate</a> *&#160;</td>
<td class="paramname"><em>date</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>flags</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Adjusts <em>date</em> up or down one day according to <em>flags</em>. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classRTC.html#aeca597e6e37a05716e664242f9cfc5f4" title="Adjusts date up or down one month according to flags.">adjustMonths()</a>, <a class="el" href="classRTC.html#a31d10cb2f7cac8839bd4be2d858b802d" title="Adjusts date up or down one year according to flags.">adjustYears()</a> </dd></dl>
<p>Definition at line <a class="el" href="RTC_8cpp_source.html#l00280">280</a> of file <a class="el" href="RTC_8cpp_source.html">RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aeca597e6e37a05716e664242f9cfc5f4"></a><!-- doxytag: member="RTC::adjustMonths" ref="aeca597e6e37a05716e664242f9cfc5f4" args="(RTCDate *date, uint8_t flags)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void RTC::adjustMonths </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structRTCDate.html">RTCDate</a> *&#160;</td>
<td class="paramname"><em>date</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>flags</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Adjusts <em>date</em> up or down one month according to <em>flags</em>. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classRTC.html#adc29d7c43efc5a192d21965da5c3ee1d" title="Adjusts date up or down one day according to flags.">adjustDays()</a>, <a class="el" href="classRTC.html#a31d10cb2f7cac8839bd4be2d858b802d" title="Adjusts date up or down one year according to flags.">adjustYears()</a> </dd></dl>
<p>Definition at line <a class="el" href="RTC_8cpp_source.html#l00310">310</a> of file <a class="el" href="RTC_8cpp_source.html">RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a31d10cb2f7cac8839bd4be2d858b802d"></a><!-- doxytag: member="RTC::adjustYears" ref="a31d10cb2f7cac8839bd4be2d858b802d" args="(RTCDate *date, uint8_t flags)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void RTC::adjustYears </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structRTCDate.html">RTCDate</a> *&#160;</td>
<td class="paramname"><em>date</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>flags</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Adjusts <em>date</em> up or down one year according to <em>flags</em>. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classRTC.html#adc29d7c43efc5a192d21965da5c3ee1d" title="Adjusts date up or down one day according to flags.">adjustDays()</a>, <a class="el" href="classRTC.html#aeca597e6e37a05716e664242f9cfc5f4" title="Adjusts date up or down one month according to flags.">adjustMonths()</a> </dd></dl>
<p>Definition at line <a class="el" href="RTC_8cpp_source.html#l00337">337</a> of file <a class="el" href="RTC_8cpp_source.html">RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="acfdebfb449710e44e11f9a3675e14fd8"></a><!-- doxytag: member="RTC::byteCount" ref="acfdebfb449710e44e11f9a3675e14fd8" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int RTC::byteCount </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings, excluding storage used by alarms. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classRTC.html#a0f47b10b436e3f9d36e04ec907579431" title="Reads the byte at offset within the realtime clock&#39;s non-volatile memory.">readByte()</a>, <a class="el" href="classRTC.html#a1cab6397ec04b1e2b3feea5b3cd1f749" title="Writes value to offset within the realtime clock&#39;s non-volatile memory.">writeByte()</a> </dd></dl>
<p>Reimplemented in <a class="el" href="classDS1307RTC.html#a93c25269a9b78ab3331354db26672248">DS1307RTC</a>, and <a class="el" href="classDS3232RTC.html#a1319fe936dcb7e9d6bdf200b77a94f8e">DS3232RTC</a>.</p>
<p>Definition at line <a class="el" href="RTC_8cpp_source.html#l00220">220</a> of file <a class="el" href="RTC_8cpp_source.html">RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a3690761f29654a2c9e676fcbfa32dd30"></a><!-- doxytag: member="RTC::hasUpdates" ref="a3690761f29654a2c9e676fcbfa32dd30" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool RTC::hasUpdates </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns true if the realtime clock has updated since the last call to this function. </p>
<p>The default implementation returns true, indicating that an update is always available to be read. </p>
<p>Reimplemented in <a class="el" href="classDS1307RTC.html#a6fec8ff71f33cc1a129eb0bd009600b0">DS1307RTC</a>, and <a class="el" href="classDS3232RTC.html#a619ffee1bc013c9ddf4ae415115798bc">DS3232RTC</a>.</p>
<p>Definition at line <a class="el" href="RTC_8cpp_source.html#l00119">119</a> of file <a class="el" href="RTC_8cpp_source.html">RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ade282d7a60147c3f0269f1fcd59c8d66"></a><!-- doxytag: member="RTC::readAlarm" ref="ade282d7a60147c3f0269f1fcd59c8d66" args="(uint8_t alarmNum, RTCAlarm *value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void RTC::readAlarm </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>alarmNum</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structRTCAlarm.html">RTCAlarm</a> *&#160;</td>
<td class="paramname"><em>value</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reads the details of the alarm with index <em>alarmNum</em> into <em>value</em>. </p>
<p>The <em>alarmNum</em> parameter must be between 0 and <a class="el" href="classRTC.html#aee5ae8f600ee5296e65635c0d836fca3">ALARM_COUNT</a> - 1.</p>
<p>Alarm details are stored at the end of the realtime clock's non-volatile memory.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classRTC.html#a0e96c91efd9e7a6340effdae3eadf17e" title="Updates the details of the alarm with index alarmNum from value.">writeAlarm()</a>, alarmCount() </dd></dl>
<p>Reimplemented in <a class="el" href="classDS1307RTC.html#aab608eb1630520ee122306b721fdc47a">DS1307RTC</a>, and <a class="el" href="classDS3232RTC.html#a09c7073c687dcbbc423baf48074c7873">DS3232RTC</a>.</p>
<p>Definition at line <a class="el" href="RTC_8cpp_source.html#l00194">194</a> of file <a class="el" href="RTC_8cpp_source.html">RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a0f47b10b436e3f9d36e04ec907579431"></a><!-- doxytag: member="RTC::readByte" ref="a0f47b10b436e3f9d36e04ec907579431" args="(uint8_t offset)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint8_t RTC::readByte </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>offset</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reads the byte at <em>offset</em> within the realtime clock's non-volatile memory. </p>
<p>The <em>offset</em> parameter must be between 0 and <a class="el" href="classRTC.html#acfdebfb449710e44e11f9a3675e14fd8" title="Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings...">byteCount()</a> - 1.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classRTC.html#a1cab6397ec04b1e2b3feea5b3cd1f749" title="Writes value to offset within the realtime clock&#39;s non-volatile memory.">writeByte()</a>, <a class="el" href="classRTC.html#acfdebfb449710e44e11f9a3675e14fd8" title="Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings...">byteCount()</a> </dd></dl>
<p>Reimplemented in <a class="el" href="classDS1307RTC.html#a7364609a201022688778ab116c3e4f4a">DS1307RTC</a>, and <a class="el" href="classDS3232RTC.html#a5ba83a3ef7d65d45c2f3241afdd8fef7">DS3232RTC</a>.</p>
<p>Definition at line <a class="el" href="RTC_8cpp_source.html#l00232">232</a> of file <a class="el" href="RTC_8cpp_source.html">RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aa1e21bf42ebd4456919744ae0f4f631e"></a><!-- doxytag: member="RTC::readDate" ref="aa1e21bf42ebd4456919744ae0f4f631e" args="(RTCDate *value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void RTC::readDate </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structRTCDate.html">RTCDate</a> *&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reads the current date from the realtime clock into <em>value</em>. </p>
<p>The time should be read first with <a class="el" href="classRTC.html#aaf0a5c1f32f210a49718d148620b5bec" title="Reads the current time from the realtime clock into value.">readTime()</a> as the default implementation only advances the date when the time is read and it crosses midnight.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classRTC.html#ae667600d05c8e7b06a93574dd068a4d7" title="Updates the date in the realtime clock to match value.">writeDate()</a>, <a class="el" href="classRTC.html#aaf0a5c1f32f210a49718d148620b5bec" title="Reads the current time from the realtime clock into value.">readTime()</a> </dd></dl>
<p>Reimplemented in <a class="el" href="classDS1307RTC.html#a6fb56d1690bc30e7995961a5b5e5fdc4">DS1307RTC</a>, and <a class="el" href="classDS3232RTC.html#ab03358e3b5996e38d766e2f9f6ab62ca">DS3232RTC</a>.</p>
<p>Definition at line <a class="el" href="RTC_8cpp_source.html#l00154">154</a> of file <a class="el" href="RTC_8cpp_source.html">RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aaf0a5c1f32f210a49718d148620b5bec"></a><!-- doxytag: member="RTC::readTime" ref="aaf0a5c1f32f210a49718d148620b5bec" args="(RTCTime *value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void RTC::readTime </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structRTCTime.html">RTCTime</a> *&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reads the current time from the realtime clock into <em>value</em>. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classRTC.html#a102e2ec15bf0273d8f7e9ce4b6dcc96e" title="Updates the time in the realtime clock to match value.">writeTime()</a>, <a class="el" href="classRTC.html#aa1e21bf42ebd4456919744ae0f4f631e" title="Reads the current date from the realtime clock into value.">readDate()</a> </dd></dl>
<p>Reimplemented in <a class="el" href="classDS1307RTC.html#acd9800d6df2244b8e4e790480a1d62a6">DS1307RTC</a>, and <a class="el" href="classDS3232RTC.html#af89e68c68f1c4b7e94286f800b5b2747">DS3232RTC</a>.</p>
<p>Definition at line <a class="el" href="RTC_8cpp_source.html#l00129">129</a> of file <a class="el" href="RTC_8cpp_source.html">RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a0e96c91efd9e7a6340effdae3eadf17e"></a><!-- doxytag: member="RTC::writeAlarm" ref="a0e96c91efd9e7a6340effdae3eadf17e" args="(uint8_t alarmNum, const RTCAlarm *value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void RTC::writeAlarm </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>alarmNum</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="structRTCAlarm.html">RTCAlarm</a> *&#160;</td>
<td class="paramname"><em>value</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Updates the details of the alarm with index <em>alarmNum</em> from <em>value</em>. </p>
<p>The <em>alarmNum</em> parameter must be between 0 and <a class="el" href="classRTC.html#aee5ae8f600ee5296e65635c0d836fca3">ALARM_COUNT</a> - 1.</p>
<p>Alarm details are stored at the end of the realtime clock's non-volatile memory.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classRTC.html#ade282d7a60147c3f0269f1fcd59c8d66" title="Reads the details of the alarm with index alarmNum into value.">readAlarm()</a>, alarmCount() </dd></dl>
<p>Reimplemented in <a class="el" href="classDS1307RTC.html#a7354aed91d7c94d0d7b2144b1bf32c75">DS1307RTC</a>, and <a class="el" href="classDS3232RTC.html#a8b0a65e0ac479aec8fad6ca3147dbe75">DS3232RTC</a>.</p>
<p>Definition at line <a class="el" href="RTC_8cpp_source.html#l00209">209</a> of file <a class="el" href="RTC_8cpp_source.html">RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a1cab6397ec04b1e2b3feea5b3cd1f749"></a><!-- doxytag: member="RTC::writeByte" ref="a1cab6397ec04b1e2b3feea5b3cd1f749" args="(uint8_t offset, uint8_t value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void RTC::writeByte </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>offset</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>value</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Writes <em>value</em> to <em>offset</em> within the realtime clock's non-volatile memory. </p>
<p>The <em>offset</em> parameter must be between 0 and <a class="el" href="classRTC.html#acfdebfb449710e44e11f9a3675e14fd8" title="Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings...">byteCount()</a> - 1.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classRTC.html#a0f47b10b436e3f9d36e04ec907579431" title="Reads the byte at offset within the realtime clock&#39;s non-volatile memory.">readByte()</a>, <a class="el" href="classRTC.html#acfdebfb449710e44e11f9a3675e14fd8" title="Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings...">byteCount()</a> </dd></dl>
<p>Reimplemented in <a class="el" href="classDS1307RTC.html#a6ef435fd4aa4adf8eefdf8b1741f5ba6">DS1307RTC</a>, and <a class="el" href="classDS3232RTC.html#a9acebf12c5cecdd6d84e0ff9ed41765a">DS3232RTC</a>.</p>
<p>Definition at line <a class="el" href="RTC_8cpp_source.html#l00247">247</a> of file <a class="el" href="RTC_8cpp_source.html">RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ae667600d05c8e7b06a93574dd068a4d7"></a><!-- doxytag: member="RTC::writeDate" ref="ae667600d05c8e7b06a93574dd068a4d7" args="(const RTCDate *value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void RTC::writeDate </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="structRTCDate.html">RTCDate</a> *&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Updates the date in the realtime clock to match <em>value</em>. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classRTC.html#aa1e21bf42ebd4456919744ae0f4f631e" title="Reads the current date from the realtime clock into value.">readDate()</a>, <a class="el" href="classRTC.html#a102e2ec15bf0273d8f7e9ce4b6dcc96e" title="Updates the time in the realtime clock to match value.">writeTime()</a> </dd></dl>
<p>Reimplemented in <a class="el" href="classDS1307RTC.html#a4f7346be33612cf9ecd96080eb046230">DS1307RTC</a>, and <a class="el" href="classDS3232RTC.html#a31c004a90c724979d8267c31f2dbf5ed">DS3232RTC</a>.</p>
<p>Definition at line <a class="el" href="RTC_8cpp_source.html#l00179">179</a> of file <a class="el" href="RTC_8cpp_source.html">RTC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a102e2ec15bf0273d8f7e9ce4b6dcc96e"></a><!-- doxytag: member="RTC::writeTime" ref="a102e2ec15bf0273d8f7e9ce4b6dcc96e" args="(const RTCTime *value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void RTC::writeTime </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="structRTCTime.html">RTCTime</a> *&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Updates the time in the realtime clock to match <em>value</em>. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classRTC.html#aaf0a5c1f32f210a49718d148620b5bec" title="Reads the current time from the realtime clock into value.">readTime()</a>, <a class="el" href="classRTC.html#ae667600d05c8e7b06a93574dd068a4d7" title="Updates the date in the realtime clock to match value.">writeDate()</a> </dd></dl>
<p>Reimplemented in <a class="el" href="classDS1307RTC.html#a0a5d0d86a0345420ebb289ea724b19e8">DS1307RTC</a>, and <a class="el" href="classDS3232RTC.html#ab0ca13a8b80da856b37fc53b84e27c78">DS3232RTC</a>.</p>
<p>Definition at line <a class="el" href="RTC_8cpp_source.html#l00164">164</a> of file <a class="el" href="RTC_8cpp_source.html">RTC.cpp</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="RTC_8h_source.html">RTC.h</a></li>
<li><a class="el" href="RTC_8cpp_source.html">RTC.cpp</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

BIN
classRTC.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

View File

@ -0,0 +1,90 @@
<!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"/>
<title>ArduinoLibs: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">RTCAlarm Member List</div> </div>
</div>
<div class="contents">
This is the complete list of members for <a class="el" href="structRTCAlarm.html">RTCAlarm</a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="structRTCAlarm.html#a0f2ef7363cb60a26642d5295b77ca19e">flags</a></td><td><a class="el" href="structRTCAlarm.html">RTCAlarm</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structRTCAlarm.html#a75bdc42acd3ab3ad495680c6b6a34692">hour</a></td><td><a class="el" href="structRTCAlarm.html">RTCAlarm</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structRTCAlarm.html#ad9a75ceb4b4b3474baa66dd5466e62fe">minute</a></td><td><a class="el" href="structRTCAlarm.html">RTCAlarm</a></td><td></td></tr>
</table></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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

90
classRTCDate-members.html Normal file
View File

@ -0,0 +1,90 @@
<!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"/>
<title>ArduinoLibs: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">RTCDate Member List</div> </div>
</div>
<div class="contents">
This is the complete list of members for <a class="el" href="structRTCDate.html">RTCDate</a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="structRTCDate.html#a2d68ff3fb90240df522b41222362704c">day</a></td><td><a class="el" href="structRTCDate.html">RTCDate</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structRTCDate.html#a6e6196059b36186041a5312400ea9202">month</a></td><td><a class="el" href="structRTCDate.html">RTCDate</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structRTCDate.html#a7d31822daff3c3fc947386abd897732f">year</a></td><td><a class="el" href="structRTCDate.html">RTCDate</a></td><td></td></tr>
</table></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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

90
classRTCTime-members.html Normal file
View File

@ -0,0 +1,90 @@
<!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"/>
<title>ArduinoLibs: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">RTCTime Member List</div> </div>
</div>
<div class="contents">
This is the complete list of members for <a class="el" href="structRTCTime.html">RTCTime</a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="structRTCTime.html#a98ba717092ef856dd2b773ba02fcb1a4">hour</a></td><td><a class="el" href="structRTCTime.html">RTCTime</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structRTCTime.html#acf2161ca037080dc4b767e636ad8db84">minute</a></td><td><a class="el" href="structRTCTime.html">RTCTime</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structRTCTime.html#a87b7c02e535d808dcba04c77e34abb91">second</a></td><td><a class="el" href="structRTCTime.html">RTCTime</a></td><td></td></tr>
</table></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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

95
classSoftI2C-members.html Normal file
View File

@ -0,0 +1,95 @@
<!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"/>
<title>ArduinoLibs: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">SoftI2C Member List</div> </div>
</div>
<div class="contents">
This is the complete list of members for <a class="el" href="classSoftI2C.html">SoftI2C</a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="classSoftI2C.html#a849af91018caedbb82e83f02c543305e">available</a>()</td><td><a class="el" href="classSoftI2C.html">SoftI2C</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classSoftI2C.html#aa12ae82813598b2e9ea70463c23c5bf3">endWrite</a>()</td><td><a class="el" href="classSoftI2C.html">SoftI2C</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classSoftI2C.html#aad488669f28f6a5a4ceaae3de61d38f4">maxTransferSize</a>() const </td><td><a class="el" href="classSoftI2C.html">SoftI2C</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classSoftI2C.html#a330dbba5b726fa161a6b01a9ca49e1bc">read</a>()</td><td><a class="el" href="classSoftI2C.html">SoftI2C</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classSoftI2C.html#adb6e00ee3f930f1d32010a18feb5f6cc">SoftI2C</a>(uint8_t dataPin, uint8_t clockPin)</td><td><a class="el" href="classSoftI2C.html">SoftI2C</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classSoftI2C.html#aa0dafc067cfa374af75e060dca647ec3">startRead</a>(unsigned int address, unsigned int count)</td><td><a class="el" href="classSoftI2C.html">SoftI2C</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classSoftI2C.html#aa8a3219f4e6ff52306cc3c219f37d8f9">startWrite</a>(unsigned int address)</td><td><a class="el" href="classSoftI2C.html">SoftI2C</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classSoftI2C.html#ab46f0b6363c9cfe6fb3ab907956d5d73">write</a>(uint8_t value)</td><td><a class="el" href="classSoftI2C.html">SoftI2C</a></td><td><code> [virtual]</code></td></tr>
</table></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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

293
classSoftI2C.html Normal file
View File

@ -0,0 +1,293 @@
<!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"/>
<title>ArduinoLibs: SoftI2C Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> </div>
<div class="headertitle">
<div class="title">SoftI2C Class Reference</div> </div>
</div>
<div class="contents">
<!-- doxytag: class="SoftI2C" --><!-- doxytag: inherits="I2CMaster" -->
<p>Bit-banged implementation of an I2C master.
<a href="classSoftI2C.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="SoftI2C_8h_source.html">SoftI2C.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for SoftI2C:</div>
<div class="dyncontent">
<div class="center">
<img src="classSoftI2C.png" usemap="#SoftI2C_map" alt=""/>
<map id="SoftI2C_map" name="SoftI2C_map">
<area href="classI2CMaster.html" title="Abstract base class for I2C master implementations." alt="I2CMaster" shape="rect" coords="0,0,70,24"/>
</map>
</div></div>
<p><a href="classSoftI2C-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adb6e00ee3f930f1d32010a18feb5f6cc"></a><!-- doxytag: member="SoftI2C::SoftI2C" ref="adb6e00ee3f930f1d32010a18feb5f6cc" args="(uint8_t dataPin, uint8_t clockPin)" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoftI2C.html#adb6e00ee3f930f1d32010a18feb5f6cc">SoftI2C</a> (uint8_t dataPin, uint8_t clockPin)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new software I2C master on <em>dataPin</em> and <em>clockPin</em>. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aad488669f28f6a5a4ceaae3de61d38f4"></a><!-- doxytag: member="SoftI2C::maxTransferSize" ref="aad488669f28f6a5a4ceaae3de61d38f4" args="() const " -->
unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoftI2C.html#aad488669f28f6a5a4ceaae3de61d38f4">maxTransferSize</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the maximum number of bytes that can be read or written in a single request by this bus master. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoftI2C.html#aa8a3219f4e6ff52306cc3c219f37d8f9">startWrite</a> (unsigned int address)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Starts a write operation by sending a start condition and the I2C control byte. <a href="#aa8a3219f4e6ff52306cc3c219f37d8f9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoftI2C.html#ab46f0b6363c9cfe6fb3ab907956d5d73">write</a> (uint8_t value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes a single byte <em>value</em> on the I2C bus. <a href="#ab46f0b6363c9cfe6fb3ab907956d5d73"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoftI2C.html#aa12ae82813598b2e9ea70463c23c5bf3">endWrite</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Ends the current write operation. <a href="#aa12ae82813598b2e9ea70463c23c5bf3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoftI2C.html#aa0dafc067cfa374af75e060dca647ec3">startRead</a> (unsigned int address, unsigned int count)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Starts a read operation for <em>count</em> bytes by sending the start condition and the I2C control byte. <a href="#aa0dafc067cfa374af75e060dca647ec3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoftI2C.html#a849af91018caedbb82e83f02c543305e">available</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of bytes that are still available for reading. <a href="#a849af91018caedbb82e83f02c543305e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoftI2C.html#a330dbba5b726fa161a6b01a9ca49e1bc">read</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads a single byte from the I2C bus. <a href="#a330dbba5b726fa161a6b01a9ca49e1bc"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Bit-banged implementation of an I2C master. </p>
<p>This class implements the I2C master protocol on any arbitrary pair of data and clock pins. It is not restricted to pre-defined pins as is the case for the standard Arduino two-wire interface.</p>
<p>This implementation only implements the master side of the protocol. It assumes that there is a single bus master, no arbitration, and no clock stretching.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classI2CMaster.html" title="Abstract base class for I2C master implementations.">I2CMaster</a> </dd></dl>
<p>Definition at line <a class="el" href="SoftI2C_8h_source.html#l00028">28</a> of file <a class="el" href="SoftI2C_8h_source.html">SoftI2C.h</a>.</p>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a849af91018caedbb82e83f02c543305e"></a><!-- doxytag: member="SoftI2C::available" ref="a849af91018caedbb82e83f02c543305e" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned int SoftI2C::available </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the number of bytes that are still available for reading. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classSoftI2C.html#aa0dafc067cfa374af75e060dca647ec3" title="Starts a read operation for count bytes by sending the start condition and the I2C control byte...">startRead()</a>, <a class="el" href="classSoftI2C.html#a330dbba5b726fa161a6b01a9ca49e1bc" title="Reads a single byte from the I2C bus.">read()</a> </dd></dl>
<p>Implements <a class="el" href="classI2CMaster.html#a6458fa99cfd9e6270ae6dff993955833">I2CMaster</a>.</p>
<p>Definition at line <a class="el" href="SoftI2C_8cpp_source.html#l00155">155</a> of file <a class="el" href="SoftI2C_8cpp_source.html">SoftI2C.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aa12ae82813598b2e9ea70463c23c5bf3"></a><!-- doxytag: member="SoftI2C::endWrite" ref="aa12ae82813598b2e9ea70463c23c5bf3" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool SoftI2C::endWrite </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Ends the current write operation. </p>
<p>Returns true if the write operation was acknowledged; false otherwise.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classSoftI2C.html#aa8a3219f4e6ff52306cc3c219f37d8f9" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite()</a>, <a class="el" href="classSoftI2C.html#ab46f0b6363c9cfe6fb3ab907956d5d73" title="Writes a single byte value on the I2C bus.">write()</a> </dd></dl>
<p>Implements <a class="el" href="classI2CMaster.html#ab29f63551ddeb032a91505d1c0b8ac41">I2CMaster</a>.</p>
<p>Definition at line <a class="el" href="SoftI2C_8cpp_source.html#l00129">129</a> of file <a class="el" href="SoftI2C_8cpp_source.html">SoftI2C.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a330dbba5b726fa161a6b01a9ca49e1bc"></a><!-- doxytag: member="SoftI2C::read" ref="a330dbba5b726fa161a6b01a9ca49e1bc" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint8_t SoftI2C::read </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reads a single byte from the I2C bus. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classSoftI2C.html#aa0dafc067cfa374af75e060dca647ec3" title="Starts a read operation for count bytes by sending the start condition and the I2C control byte...">startRead()</a>, <a class="el" href="classSoftI2C.html#a849af91018caedbb82e83f02c543305e" title="Returns the number of bytes that are still available for reading.">available()</a> </dd></dl>
<p>Implements <a class="el" href="classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd">I2CMaster</a>.</p>
<p>Definition at line <a class="el" href="SoftI2C_8cpp_source.html#l00160">160</a> of file <a class="el" href="SoftI2C_8cpp_source.html">SoftI2C.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aa0dafc067cfa374af75e060dca647ec3"></a><!-- doxytag: member="SoftI2C::startRead" ref="aa0dafc067cfa374af75e060dca647ec3" args="(unsigned int address, unsigned int count)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool SoftI2C::startRead </td>
<td>(</td>
<td class="paramtype">unsigned int&#160;</td>
<td class="paramname"><em>address</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int&#160;</td>
<td class="paramname"><em>count</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Starts a read operation for <em>count</em> bytes by sending the start condition and the I2C control byte. </p>
<p>The <em>address</em> must be the 7-bit or 10-bit address of the I2C slave on the bus.</p>
<p>Returns true if the read request was acknowledged by the I2C slave or false otherwise. If true, this function should be followed by <em>count</em> calls to <a class="el" href="classSoftI2C.html#a330dbba5b726fa161a6b01a9ca49e1bc" title="Reads a single byte from the I2C bus.">read()</a> to fetch the bytes.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classSoftI2C.html#a849af91018caedbb82e83f02c543305e" title="Returns the number of bytes that are still available for reading.">available()</a>, <a class="el" href="classSoftI2C.html#a330dbba5b726fa161a6b01a9ca49e1bc" title="Reads a single byte from the I2C bus.">read()</a>, <a class="el" href="classSoftI2C.html#aa8a3219f4e6ff52306cc3c219f37d8f9" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite()</a> </dd></dl>
<p>Implements <a class="el" href="classI2CMaster.html#a4e5f1a1a4c2242699be5a35fc4872fde">I2CMaster</a>.</p>
<p>Definition at line <a class="el" href="SoftI2C_8cpp_source.html#l00135">135</a> of file <a class="el" href="SoftI2C_8cpp_source.html">SoftI2C.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aa8a3219f4e6ff52306cc3c219f37d8f9"></a><!-- doxytag: member="SoftI2C::startWrite" ref="aa8a3219f4e6ff52306cc3c219f37d8f9" args="(unsigned int address)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void SoftI2C::startWrite </td>
<td>(</td>
<td class="paramtype">unsigned int&#160;</td>
<td class="paramname"><em>address</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Starts a write operation by sending a start condition and the I2C control byte. </p>
<p>The <em>address</em> must be the 7-bit or 10-bit address of the I2C slave on the bus.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classSoftI2C.html#ab46f0b6363c9cfe6fb3ab907956d5d73" title="Writes a single byte value on the I2C bus.">write()</a>, <a class="el" href="classSoftI2C.html#aa12ae82813598b2e9ea70463c23c5bf3" title="Ends the current write operation.">endWrite()</a>, <a class="el" href="classSoftI2C.html#aa0dafc067cfa374af75e060dca647ec3" title="Starts a read operation for count bytes by sending the start condition and the I2C control byte...">startRead()</a> </dd></dl>
<p>Reimplemented from <a class="el" href="classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35">I2CMaster</a>.</p>
<p>Definition at line <a class="el" href="SoftI2C_8cpp_source.html#l00104">104</a> of file <a class="el" href="SoftI2C_8cpp_source.html">SoftI2C.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ab46f0b6363c9cfe6fb3ab907956d5d73"></a><!-- doxytag: member="SoftI2C::write" ref="ab46f0b6363c9cfe6fb3ab907956d5d73" args="(uint8_t value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void SoftI2C::write </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Writes a single byte <em>value</em> on the I2C bus. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classSoftI2C.html#aa8a3219f4e6ff52306cc3c219f37d8f9" title="Starts a write operation by sending a start condition and the I2C control byte.">startWrite()</a>, <a class="el" href="classSoftI2C.html#aa12ae82813598b2e9ea70463c23c5bf3" title="Ends the current write operation.">endWrite()</a> </dd></dl>
<p>Implements <a class="el" href="classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960">I2CMaster</a>.</p>
<p>Definition at line <a class="el" href="SoftI2C_8cpp_source.html#l00118">118</a> of file <a class="el" href="SoftI2C_8cpp_source.html">SoftI2C.cpp</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="SoftI2C_8h_source.html">SoftI2C.h</a></li>
<li><a class="el" href="SoftI2C_8cpp_source.html">SoftI2C.cpp</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

BIN
classSoftI2C.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 B

103
classTextField-members.html Normal file
View File

@ -0,0 +1,103 @@
<!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"/>
<title>ArduinoLibs: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">TextField Member List</div> </div>
</div>
<div class="contents">
This is the complete list of members for <a class="el" href="classTextField.html">TextField</a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="classField.html#a061bd1ed4d8b079df86465df8facd3b3">dispatch</a>(int event)</td><td><a class="el" href="classField.html">Field</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classTextField.html#aa78f1354f9240b64fabd6f996e312f32">enterField</a>(bool reverse)</td><td><a class="el" href="classTextField.html">TextField</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#ad6805c75ee1e62f8cd8bd550c4530c07">exitField</a>()</td><td><a class="el" href="classField.html">Field</a></td><td><code> [virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#ac4ea0d104376233c3f0bfc080ec8564e">Field</a>(const String &amp;label)</td><td><a class="el" href="classField.html">Field</a></td><td><code> [explicit]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#a7e2bdb203ddfd9219696f263c1731fe7">Field</a>(Form &amp;form, const String &amp;label)</td><td><a class="el" href="classField.html">Field</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#a27427319be1cc92db3128637d8884ee5">form</a>() const </td><td><a class="el" href="classField.html">Field</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#a25d86a67b321e8c642edf75a10a35f72">isCurrent</a>() const </td><td><a class="el" href="classField.html">Field</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#aaa861ef917130c989a955bc75c683afe">label</a>() const </td><td><a class="el" href="classField.html">Field</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#a5cf21bf958a71e51feac9e1bf9f599d1">lcd</a>() const </td><td><a class="el" href="classField.html">Field</a></td><td><code> [inline, protected]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#ad4ea63599d780c35b296cf2840b69f7b">setLabel</a>(const String &amp;label)</td><td><a class="el" href="classField.html">Field</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classTextField.html#a24b98c5bb744331bf0a5facc8ea9c033">setValue</a>(const String &amp;value)</td><td><a class="el" href="classTextField.html">TextField</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classTextField.html#a5108741ab147b2cd5a399fefbe0a2382">TextField</a>(const String &amp;label)</td><td><a class="el" href="classTextField.html">TextField</a></td><td><code> [explicit]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classTextField.html#a24096a344d9161b2c99ce724ec2ee93c">TextField</a>(Form &amp;form, const String &amp;label, const String &amp;value)</td><td><a class="el" href="classTextField.html">TextField</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#afc612378167be0e7f8a6f8395b3537bd">updateCursor</a>()</td><td><a class="el" href="classField.html">Field</a></td><td><code> [protected, virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classTextField.html#a124764b6fc7c19aaf683f72cd42636b1">value</a>() const </td><td><a class="el" href="classTextField.html">TextField</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classField.html#a45d6e6d09b8f8e46de62b40119d62c60">~Field</a>()</td><td><a class="el" href="classField.html">Field</a></td><td></td></tr>
</table></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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

275
classTextField.html Normal file
View File

@ -0,0 +1,275 @@
<!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"/>
<title>ArduinoLibs: TextField Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<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>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="searchli">
<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&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> </div>
<div class="headertitle">
<div class="title">TextField Class Reference</div> </div>
</div>
<div class="contents">
<!-- doxytag: class="TextField" --><!-- doxytag: inherits="Field" -->
<p><a class="el" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> that displays a read-only text value.
<a href="classTextField.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="TextField_8h_source.html">TextField.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for TextField:</div>
<div class="dyncontent">
<div class="center">
<img src="classTextField.png" usemap="#TextField_map" alt=""/>
<map id="TextField_map" name="TextField_map">
<area href="classField.html" title="Manages a single data input/output field within a Form." alt="Field" shape="rect" coords="0,0,63,24"/>
</map>
</div></div>
<p><a href="classTextField-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTextField.html#a5108741ab147b2cd5a399fefbe0a2382">TextField</a> (const String &amp;label)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new text field with a specific <em>label</em>. <a href="#a5108741ab147b2cd5a399fefbe0a2382"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTextField.html#a24096a344d9161b2c99ce724ec2ee93c">TextField</a> (<a class="el" href="classForm.html">Form</a> &amp;form, const String &amp;label, const String &amp;value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new text field with a specific <em>label</em> and <em>value</em> attaches it to a <em>form</em>. <a href="#a24096a344d9161b2c99ce724ec2ee93c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTextField.html#aa78f1354f9240b64fabd6f996e312f32">enterField</a> (bool reverse)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Enters the field due to form navigation. <a href="#aa78f1354f9240b64fabd6f996e312f32"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const String &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTextField.html#a124764b6fc7c19aaf683f72cd42636b1">value</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the text value that is currently displayed by this field. <a href="#a124764b6fc7c19aaf683f72cd42636b1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTextField.html#a24b98c5bb744331bf0a5facc8ea9c033">setValue</a> (const String &amp;value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the text <em>value</em> that is displayed by this field. <a href="#a24b98c5bb744331bf0a5facc8ea9c033"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p><a class="el" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> that displays a read-only text value. </p>
<p>This following example displays a text field with the label "Form example" and a <a class="el" href="classTextField.html#a124764b6fc7c19aaf683f72cd42636b1" title="Returns the text value that is currently displayed by this field.">value()</a> of "v1.0".</p>
<div class="fragment"><pre class="fragment"> <a class="code" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a> mainForm(lcd);
<a class="code" href="classTextField.html" title="Field that displays a read-only text value.">TextField</a> welcomeField(mainForm, <span class="stringliteral">&quot;Form example&quot;</span>, <span class="stringliteral">&quot;v1.0&quot;</span>);
</pre></div><div class="image">
<img src="FormText.png" alt="FormText.png"/>
</div>
<p>As well as static messages, <a class="el" href="classTextField.html" title="Field that displays a read-only text value.">TextField</a> can be used to display read-only information that is computed at runtime:</p>
<div class="fragment"><pre class="fragment"> <a class="code" href="classTextField.html" title="Field that displays a read-only text value.">TextField</a> timeField(mainForm, <span class="stringliteral">&quot;Time since reset&quot;</span>, <span class="stringliteral">&quot;0&quot;</span>);
<span class="keywordtype">void</span> loop() {
timeField.setValue(millis() / 1000);
mainForm.dispatch(lcd.<a class="code" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292" title="Gets the next button press, release, or idle event.">getButton</a>());
}
</pre></div><p>For writable fields, use <a class="el" href="classBoolField.html" title="Field that manages the input of a boolean value.">BoolField</a>, <a class="el" href="classIntField.html" title="Field that manages the input of an integer value.">IntField</a>, or <a class="el" href="classTimeField.html" title="Field that manages the display and editing of a time value.">TimeField</a>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a> </dd></dl>
<p>Definition at line <a class="el" href="TextField_8h_source.html#l00028">28</a> of file <a class="el" href="TextField_8h_source.html">TextField.h</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a5108741ab147b2cd5a399fefbe0a2382"></a><!-- doxytag: member="TextField::TextField" ref="a5108741ab147b2cd5a399fefbe0a2382" args="(const String &amp;label)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">TextField::TextField </td>
<td>(</td>
<td class="paramtype">const String &amp;&#160;</td>
<td class="paramname"><em>label</em></td><td>)</td>
<td><code> [explicit]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs a new text field with a specific <em>label</em>. </p>
<p>The field is initially not associated with a <a class="el" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a>. The field can be added to a form later using <a class="el" href="classForm.html#a5cb056ace428e75e321610555bfecac7" title="Adds field to this form.">Form::addField()</a>.</p>
<p>The initial <a class="el" href="classTextField.html#a124764b6fc7c19aaf683f72cd42636b1" title="Returns the text value that is currently displayed by this field.">value()</a> will be the empty string.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classForm.html#a5cb056ace428e75e321610555bfecac7" title="Adds field to this form.">Form::addField()</a> </dd></dl>
<p>Definition at line <a class="el" href="TextField_8cpp_source.html#l00066">66</a> of file <a class="el" href="TextField_8cpp_source.html">TextField.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a24096a344d9161b2c99ce724ec2ee93c"></a><!-- doxytag: member="TextField::TextField" ref="a24096a344d9161b2c99ce724ec2ee93c" args="(Form &amp;form, const String &amp;label, const String &amp;value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">TextField::TextField </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classForm.html">Form</a> &amp;&#160;</td>
<td class="paramname"><em>form</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const String &amp;&#160;</td>
<td class="paramname"><em>label</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const String &amp;&#160;</td>
<td class="paramname"><em>value</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs a new text field with a specific <em>label</em> and <em>value</em> attaches it to a <em>form</em>. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classTextField.html#a124764b6fc7c19aaf683f72cd42636b1" title="Returns the text value that is currently displayed by this field.">value()</a> </dd></dl>
<p>Definition at line <a class="el" href="TextField_8cpp_source.html#l00077">77</a> of file <a class="el" href="TextField_8cpp_source.html">TextField.cpp</a>.</p>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="aa78f1354f9240b64fabd6f996e312f32"></a><!-- doxytag: member="TextField::enterField" ref="aa78f1354f9240b64fabd6f996e312f32" args="(bool reverse)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void TextField::enterField </td>
<td>(</td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>reverse</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Enters the field due to form navigation. </p>
<p>This function is typically called when the user presses Left and Right buttons to navigate to the field. If <em>reverse</em> is true, then navigation was due to the Left button being pressed.</p>
<p>This function can assume that the display has been cleared and the cursor is positioned at (0, 0).</p>
<p>The default implementation prints the <a class="el" href="classField.html#aaa861ef917130c989a955bc75c683afe" title="Returns the label to display in the first line of this field.">label()</a>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classField.html#ad6805c75ee1e62f8cd8bd550c4530c07" title="Exits the field due to form navigation.">exitField()</a> </dd></dl>
<p>Reimplemented from <a class="el" href="classField.html#aa032bbeacb405c56546cb56fbbee94f5">Field</a>.</p>
<p>Definition at line <a class="el" href="TextField_8cpp_source.html#l00083">83</a> of file <a class="el" href="TextField_8cpp_source.html">TextField.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a24b98c5bb744331bf0a5facc8ea9c033"></a><!-- doxytag: member="TextField::setValue" ref="a24b98c5bb744331bf0a5facc8ea9c033" args="(const String &amp;value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void TextField::setValue </td>
<td>(</td>
<td class="paramtype">const String &amp;&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the text <em>value</em> that is displayed by this field. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classTextField.html#a124764b6fc7c19aaf683f72cd42636b1" title="Returns the text value that is currently displayed by this field.">value()</a> </dd></dl>
<p>Definition at line <a class="el" href="TextField_8cpp_source.html#l00102">102</a> of file <a class="el" href="TextField_8cpp_source.html">TextField.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a124764b6fc7c19aaf683f72cd42636b1"></a><!-- doxytag: member="TextField::value" ref="a124764b6fc7c19aaf683f72cd42636b1" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const String &amp; TextField::value </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the text value that is currently displayed by this field. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classTextField.html#a24b98c5bb744331bf0a5facc8ea9c033" title="Sets the text value that is displayed by this field.">setValue()</a> </dd></dl>
<p>Definition at line <a class="el" href="TextField_8h_source.html#l00035">35</a> of file <a class="el" href="TextField_8h_source.html">TextField.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="TextField_8h_source.html">TextField.h</a></li>
<li><a class="el" href="TextField_8cpp_source.html">TextField.cpp</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</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>
<hr class="footer"/><address class="footer"><small>Generated on Fri May 25 2012 15:10:50 for ArduinoLibs by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>

BIN
classTextField.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

Some files were not shown because too many files have changed in this diff Show More