1
0
mirror of https://github.com/taigrr/arduinolibs synced 2025-01-18 04:33:12 -08:00
arduinolibs/classLCD.html
Rhys Weatherley 11f16a223a Update docs
2016-03-13 08:28:23 +10:00

601 lines
42 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>ArduinoLibs: LCD Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">ArduinoLibs
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#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>
<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>
<!-- 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>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classLCD-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">LCD Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<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>
<div class="dynheader">
Inheritance diagram for LCD:</div>
<div class="dyncontent">
<div class="center">
<img src="classLCD.png" usemap="#LCD_map" alt=""/>
<map id="LCD_map" name="LCD_map">
</map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a264bf94308c95d8598426e13dc8cdb28"><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 class="memdesc:a264bf94308c95d8598426e13dc8cdb28"><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 class="separator:a264bf94308c95d8598426e13dc8cdb28"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a00bb2db1390721abc7b24ac4b8c276c8"><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 class="memdesc:a00bb2db1390721abc7b24ac4b8c276c8"><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">More...</a><br/></td></tr>
<tr class="separator:a00bb2db1390721abc7b24ac4b8c276c8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a067bc741cf27f143aba5d9f147908401"><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 class="memdesc:a067bc741cf27f143aba5d9f147908401"><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">More...</a><br/></td></tr>
<tr class="separator:a067bc741cf27f143aba5d9f147908401"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a203d268bef6c61fa293562dbb0e9f51e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLCD.html#a203d268bef6c61fa293562dbb0e9f51e">LCD</a> (uint8_t rs, uint8_t enable, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3)</td></tr>
<tr class="memdesc:a203d268bef6c61fa293562dbb0e9f51e"><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 custom pins. <a href="#a203d268bef6c61fa293562dbb0e9f51e">More...</a><br/></td></tr>
<tr class="separator:a203d268bef6c61fa293562dbb0e9f51e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a171f59ba80e7775ebd3a399f56482a9c"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLCD.html#a171f59ba80e7775ebd3a399f56482a9c">backlightPin</a> () const </td></tr>
<tr class="memdesc:a171f59ba80e7775ebd3a399f56482a9c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the pin that is being used to control the back light. The default is 3. <a href="#a171f59ba80e7775ebd3a399f56482a9c">More...</a><br/></td></tr>
<tr class="separator:a171f59ba80e7775ebd3a399f56482a9c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0b9b3b954290e7a3d94cdc829582b0a8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLCD.html#a0b9b3b954290e7a3d94cdc829582b0a8">setBacklightPin</a> (uint8_t pin)</td></tr>
<tr class="memdesc:a0b9b3b954290e7a3d94cdc829582b0a8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the back light <em>pin</em> for the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields. ">LCD</a> shield. <a href="#a0b9b3b954290e7a3d94cdc829582b0a8">More...</a><br/></td></tr>
<tr class="separator:a0b9b3b954290e7a3d94cdc829582b0a8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5b07cf05e8e5e7c53654f5ca0cf58b89"><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 class="memdesc:a5b07cf05e8e5e7c53654f5ca0cf58b89"><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">More...</a><br/></td></tr>
<tr class="separator:a5b07cf05e8e5e7c53654f5ca0cf58b89"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af3974da6d988ba2d21c25135ada12108"><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 class="memdesc:af3974da6d988ba2d21c25135ada12108"><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">More...</a><br/></td></tr>
<tr class="separator:af3974da6d988ba2d21c25135ada12108"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1917fa285f81f476b4c7cc20d15456b8"><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 class="memdesc:a1917fa285f81f476b4c7cc20d15456b8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current screen saver mode; default is DisplayOff. <a href="#a1917fa285f81f476b4c7cc20d15456b8">More...</a><br/></td></tr>
<tr class="separator:a1917fa285f81f476b4c7cc20d15456b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a56d1f68532c779c65fbbd071fb444801"><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 class="memdesc:a56d1f68532c779c65fbbd071fb444801"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the current screen saver <em>mode</em>. <a href="#a56d1f68532c779c65fbbd071fb444801">More...</a><br/></td></tr>
<tr class="separator:a56d1f68532c779c65fbbd071fb444801"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af9a2326d034fa159d384ec16223c924f"><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 class="memdesc:af9a2326d034fa159d384ec16223c924f"><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">More...</a><br/></td></tr>
<tr class="separator:af9a2326d034fa159d384ec16223c924f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a85c3a4694b105731404df36e35e5b26e"><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 class="memdesc:a85c3a4694b105731404df36e35e5b26e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disables the screen saver. <a href="#a85c3a4694b105731404df36e35e5b26e">More...</a><br/></td></tr>
<tr class="separator:a85c3a4694b105731404df36e35e5b26e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af5d5ca618a3161aa352027b58fe09d0e"><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 class="memdesc:af5d5ca618a3161aa352027b58fe09d0e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the screen has been saved; false otherwise. <a href="#af5d5ca618a3161aa352027b58fe09d0e">More...</a><br/></td></tr>
<tr class="separator:af5d5ca618a3161aa352027b58fe09d0e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac1e80e2603bd1cf0276c36092c416292"><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 class="memdesc:ac1e80e2603bd1cf0276c36092c416292"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the next button press, release, or idle event. <a href="#ac1e80e2603bd1cf0276c36092c416292">More...</a><br/></td></tr>
<tr class="separator:ac1e80e2603bd1cf0276c36092c416292"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">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>
<h1><a class="anchor" id="lcd_dfrobot"></a>
Support for DFRobot LCD Shield</h1>
<p>The <a href="http://www.dfrobot.com/index.php?route=product/product&amp;product_id=51">DFRobot LCD Shield</a> is almost identical to the Freetronics shield, except it uses pin 10 for the back light instead of pin 3. This can be specified in the application's <code>setup()</code> function:</p>
<div class="fragment"><div class="line"><a class="code" href="classLCD.html">LCD</a> lcd;</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> setup() {</div>
<div class="line"> lcd.<a class="code" href="classLCD.html#a0b9b3b954290e7a3d94cdc829582b0a8">setBacklightPin</a>(10);</div>
<div class="line">}</div>
</div><!-- fragment --><p>The back light pin is configured for output the first time the application calls <a class="el" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292" title="Gets the next button press, release, or idle event. ">getButton()</a>.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classForm.html" title="Manager for a form containing data input/output fields. ">Form</a>, <a class="el" href="lcd_hello_world.html">Hello World Example</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><h2 class="groupheader">Member Enumeration Documentation</h2>
<a class="anchor" id="a264bf94308c95d8598426e13dc8cdb28"></a>
<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>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="a264bf94308c95d8598426e13dc8cdb28a3f1e62d5fcd314d6ff067d3e74c4bf5f"></a>DisplayOff</em>&#160;</td><td class="fielddoc">
<p>Turn off both the display and the backlight when the screen saver is activated. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a264bf94308c95d8598426e13dc8cdb28a9931c078cfd1023c69f1da431f9a656c"></a>BacklightOff</em>&#160;</td><td class="fielddoc">
<p>Turn off the back light but leave the display on when the screen saver is activated. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a264bf94308c95d8598426e13dc8cdb28a781f3c5e42506bf4f86ba06d69b23d35"></a>BacklightOnSelect</em>&#160;</td><td class="fielddoc">
<p>Same as BacklightOff but the screen saver is only deactivated when Select is pressed; other buttons have no effect. </p>
</td></tr>
</table>
<p>Definition at line <a class="el" href="LCD_8h_source.html#l00062">62</a> of file <a class="el" href="LCD_8h_source.html">LCD.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a00bb2db1390721abc7b24ac4b8c276c8"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">LCD::LCD </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>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"><div class="line"><a class="code" href="classLCD.html">LCD</a> lcd;</div>
</div><!-- fragment -->
<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>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<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></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>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"><div class="line"><a class="code" href="classLCD.html">LCD</a> lcd(A1);</div>
</div><!-- fragment -->
<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>
<a class="anchor" id="a203d268bef6c61fa293562dbb0e9f51e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">LCD::LCD </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>rs</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>enable</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>d0</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>d1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>d2</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>d3</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Initialize the Freetronics <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields. ">LCD</a> display with custom pins. </p>
<p>For compatibility with other shields, it may be desirable to rewire some of the pins entirely. This version of the constructor allows any pins to be reassigned from the defaults (which are rs = 8, enable = 9, d0 = 4, d1 = 5, d2 = 6, d3 = 7.)</p>
<div class="fragment"><div class="line"><a class="code" href="classLCD.html">LCD</a> lcd(8,9,4,5,10,11);</div>
</div><!-- fragment -->
<p>Definition at line <a class="el" href="LCD_8h_source.html#l00052">52</a> of file <a class="el" href="LCD_8h_source.html">LCD.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a171f59ba80e7775ebd3a399f56482a9c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">uint8_t LCD::backlightPin </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the pin that is being used to control the back light. The default is 3. </p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classLCD.html#a0b9b3b954290e7a3d94cdc829582b0a8" title="Sets the back light pin for the LCD shield. ">setBacklightPin()</a> </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>
<a class="anchor" id="a85c3a4694b105731404df36e35e5b26e"></a>
<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="section see"><dt>See Also</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#l00323">323</a> of file <a class="el" href="LCD_8cpp_source.html">LCD.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a5b07cf05e8e5e7c53654f5ca0cf58b89"></a>
<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="section see"><dt>See Also</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#l00221">221</a> of file <a class="el" href="LCD_8cpp_source.html">LCD.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="af9a2326d034fa159d384ec16223c924f"></a>
<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 <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields. ">LCD</a>'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="section see"><dt>See Also</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#l00309">309</a> of file <a class="el" href="LCD_8cpp_source.html">LCD.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ac1e80e2603bd1cf0276c36092c416292"></a>
<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="section see"><dt>See Also</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#l00368">368</a> of file <a class="el" href="LCD_8cpp_source.html">LCD.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="af5d5ca618a3161aa352027b58fe09d0e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool LCD::isScreenSaved </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns true if the screen has been saved; false otherwise. </p>
<dl class="section see"><dt>See Also</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#l00074">74</a> of file <a class="el" href="LCD_8h_source.html">LCD.h</a>.</p>
</div>
</div>
<a class="anchor" id="af3974da6d988ba2d21c25135ada12108"></a>
<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="section see"><dt>See Also</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#l00238">238</a> of file <a class="el" href="LCD_8cpp_source.html">LCD.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a1917fa285f81f476b4c7cc20d15456b8"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<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</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the current screen saver mode; default is DisplayOff. </p>
<dl class="section see"><dt>See Also</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#l00069">69</a> of file <a class="el" href="LCD_8h_source.html">LCD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0b9b3b954290e7a3d94cdc829582b0a8"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void LCD::setBacklightPin </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>pin</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the back light <em>pin</em> for the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields. ">LCD</a> shield. </p>
<p>The <a href="http://www.dfrobot.com/index.php?route=product/product&amp;product_id=51">DFRobot LCD Shield</a> uses pin 10 for the back light instead of pin 3:</p>
<div class="fragment"><div class="line"><a class="code" href="classLCD.html">LCD</a> lcd;</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> setup() {</div>
<div class="line"> lcd.<a class="code" href="classLCD.html#a0b9b3b954290e7a3d94cdc829582b0a8">setBacklightPin</a>(10);</div>
<div class="line">}</div>
</div><!-- fragment --><p>The back light pin is configured for output the next time the application calls <a class="el" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292" title="Gets the next button press, release, or idle event. ">getButton()</a>.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classLCD.html#a171f59ba80e7775ebd3a399f56482a9c" title="Returns the pin that is being used to control the back light. The default is 3. ">backlightPin()</a> </dd></dl>
<p>Definition at line <a class="el" href="LCD_8cpp_source.html#l00197">197</a> of file <a class="el" href="LCD_8cpp_source.html">LCD.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a56d1f68532c779c65fbbd071fb444801"></a>
<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="section see"><dt>See Also</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#l00283">283</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><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sun Mar 13 2016 08:28:01 for ArduinoLibs by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>