mirror of
https://github.com/taigrr/arduinolibs
synced 2025-01-18 04:33:12 -08:00
476 lines
36 KiB
HTML
476 lines
36 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"/>
|
|
<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 Page</span></a></li>
|
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
|
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li><a href="files.html"><span>Files</span></a></li>
|
|
<li 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 List</span></a></li>
|
|
<li><a href="classes.html"><span>Class Index</span></a></li>
|
|
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
|
|
<li><a href="functions.html"><span>Class Members</span></a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#pub-types">Public Types</a> |
|
|
<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 <<a class="el" href="LCD_8h_source.html">LCD.h</a>></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  </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"> </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"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classLCD.html#a00bb2db1390721abc7b24ac4b8c276c8">LCD</a> ()</td></tr>
|
|
<tr><td class="mdescLeft"> </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"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classLCD.html#a067bc741cf27f143aba5d9f147908401">LCD</a> (uint8_t pin9)</td></tr>
|
|
<tr><td class="mdescLeft"> </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">uint8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classLCD.html#a171f59ba80e7775ebd3a399f56482a9c">backlightPin</a> () const </td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the pin that is being used to control the back light. The default is 3. <a href="#a171f59ba80e7775ebd3a399f56482a9c"></a><br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classLCD.html#a0b9b3b954290e7a3d94cdc829582b0a8">setBacklightPin</a> (uint8_t pin)</td></tr>
|
|
<tr><td class="mdescLeft"> </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"></a><br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classLCD.html#a5b07cf05e8e5e7c53654f5ca0cf58b89">display</a> ()</td></tr>
|
|
<tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign="bottom"><a class="el" href="classLCD.html#af3974da6d988ba2d21c25135ada12108">noDisplay</a> ()</td></tr>
|
|
<tr><td class="mdescLeft"> </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> </td><td class="memItemRight" valign="bottom"><a class="el" href="classLCD.html#a1917fa285f81f476b4c7cc20d15456b8">screenSaverMode</a> () const </td></tr>
|
|
<tr><td class="mdescLeft"> </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 </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"> </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 </td><td class="memItemRight" valign="bottom"><a class="el" href="classLCD.html#af9a2326d034fa159d384ec16223c924f">enableScreenSaver</a> (int timeoutSecs=10)</td></tr>
|
|
<tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign="bottom"><a class="el" href="classLCD.html#a85c3a4694b105731404df36e35e5b26e">disableScreenSaver</a> ()</td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Disables the screen saver. <a href="#a85c3a4694b105731404df36e35e5b26e"></a><br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classLCD.html#af5d5ca618a3161aa352027b58fe09d0e">isScreenSaved</a> () const </td></tr>
|
|
<tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign="bottom"><a class="el" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292">getButton</a> ()</td></tr>
|
|
<tr><td class="mdescLeft"> </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 > 0</code> and if a generic button has been released with <code>button < 0</code>.</p>
|
|
<h2><a class="anchor" id="lcd_dfrobot"></a>
|
|
Support for DFRobot LCD Shield</h2>
|
|
<p>The <a href="http://www.dfrobot.com/index.php?route=product/product&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"><pre class="fragment"> <a class="code" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> lcd;
|
|
|
|
<span class="keywordtype">void</span> setup() {
|
|
lcd.<a class="code" href="classLCD.html#a0b9b3b954290e7a3d94cdc829582b0a8" title="Sets the back light pin for the LCD shield.">setBacklightPin</a>(10);
|
|
}
|
|
</pre></div><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="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="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><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> </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> </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> </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#l00059">59</a> of file <a class="el" href="LCD_8h_source.html">LCD.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/><h2>Constructor & 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 </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="a171f59ba80e7775ebd3a399f56482a9c"></a><!-- doxytag: member="LCD::backlightPin" ref="a171f59ba80e7775ebd3a399f56482a9c" args="() const " -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">uint8_t LCD::backlightPin </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const<code> [inline]</code></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="see"><dt><b>See also:</b></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#l00053">53</a> of file <a class="el" href="LCD_8h_source.html">LCD.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<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#l00308">308</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#l00206">206</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 </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#l00294">294</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#l00353">353</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#l00071">71</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#l00223">223</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#l00066">66</a> of file <a class="el" href="LCD_8h_source.html">LCD.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a0b9b3b954290e7a3d94cdc829582b0a8"></a><!-- doxytag: member="LCD::setBacklightPin" ref="a0b9b3b954290e7a3d94cdc829582b0a8" args="(uint8_t pin)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void LCD::setBacklightPin </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint8_t </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&product_id=51">DFRobot LCD Shield</a> uses pin 10 for the back light instead of pin 3:</p>
|
|
<div class="fragment"><pre class="fragment"> <a class="code" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> lcd;
|
|
|
|
<span class="keywordtype">void</span> setup() {
|
|
lcd.<a class="code" href="classLCD.html#a0b9b3b954290e7a3d94cdc829582b0a8" title="Sets the back light pin for the LCD shield.">setBacklightPin</a>(10);
|
|
}
|
|
</pre></div><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="see"><dt><b>See also:</b></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#l00182">182</a> of file <a class="el" href="LCD_8cpp_source.html">LCD.cpp</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> </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#l00268">268</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"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a></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 Wed Jun 13 2012 15:22:30 for ArduinoLibs by 
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
|
|
</body>
|
|
</html>
|