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

Update docs

This commit is contained in:
Rhys Weatherley
2015-03-12 19:03:15 +10:00
parent 083448f195
commit c6206e4216
493 changed files with 35310 additions and 3018 deletions

View File

@@ -3,6 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>ArduinoLibs: Hello World for Freetronics LCD</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
@@ -29,7 +30,7 @@
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.2 -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
@@ -75,34 +76,34 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">Hello World for Freetronics <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> </div> </div>
<div class="title">Hello World for Freetronics <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields. ">LCD</a> </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>The <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> class provides an enhanced version of the standard Arduino <a href="http://arduino.cc/en/Reference/LiquidCrystal">LiquidCrystal</a> library that supports the additional features of the <a href="http://www.freetronics.com/pages/16x2-lcd-shield-quickstart-guide">Freetronics LCD</a> shield; namely the back light and the Up, Down, Left, Right, and Select buttons. This tutorial explains how to use the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> class to perform basic text output and to use the enhanced shield features.</p>
<div class="textblock"><p>The <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields. ">LCD</a> class provides an enhanced version of the standard Arduino <a href="http://arduino.cc/en/Reference/LiquidCrystal">LiquidCrystal</a> library that supports the additional features of the <a href="http://www.freetronics.com/pages/16x2-lcd-shield-quickstart-guide">Freetronics LCD</a> shield; namely the back light and the Up, Down, Left, Right, and Select buttons. This tutorial explains how to use the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields. ">LCD</a> class to perform basic text output and to use the enhanced shield features.</p>
<div class="image">
<img src="HelloWorld.png" alt="HelloWorld.png"/>
</div>
<p>We start by including the library and initializing it:</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &lt;LCD.h&gt;</span></div>
<div class="line"><a class="code" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> lcd;</div>
<div class="line"><a class="code" href="classLCD.html">LCD</a> lcd;</div>
</div><!-- fragment --></p>
<p>Unlike the LiquidCrystal library we don't normally need to specify the pin assignments for this shield. The one exception is when the shield is used with the USBDroid and the D9 pin is reassigned as described on <a href="http://www.freetronics.com/pages/combining-the-lcd-keypad-shield-and-the-usbdroid">this page</a>. In that case, the initialization sequence would look something like this instead:</p>
<div class="fragment"><div class="line"><a class="code" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> lcd(A1);</div>
<div class="fragment"><div class="line"><a class="code" href="classLCD.html">LCD</a> lcd(A1);</div>
</div><!-- fragment --><p>The next step is to enable the screen saver and print some text in the <code>setup</code> function:</p>
<div class="fragment"><div class="line"><span class="keywordtype">void</span> setup() {</div>
<div class="line"> lcd.<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>();</div>
<div class="line"> lcd.<a class="code" href="classLCD.html#af9a2326d034fa159d384ec16223c924f">enableScreenSaver</a>();</div>
<div class="line"> lcd.print(<span class="stringliteral">&quot;hello, world!&quot;</span>);</div>
<div class="line">}</div>
</div><!-- fragment --></p>
<p>The screen saver is a built-in feature of the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> class that turns off the display and the back light after a specific timeout (the default is 10 seconds). Pressing any of the keys on the shield or calling <a class="el" href="classLCD.html#a5b07cf05e8e5e7c53654f5ca0cf58b89" title="Turns on the display of text on the LCD and the back light.">LCD::display()</a> will wake up the screen again.</p>
<p>In the program's <code>loop</code> function we print the number of seconds since startup to the second line of the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> display:</p>
<p>The screen saver is a built-in feature of the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields. ">LCD</a> class that turns off the display and the back light after a specific timeout (the default is 10 seconds). Pressing any of the keys on the shield or calling <a class="el" href="classLCD.html#a5b07cf05e8e5e7c53654f5ca0cf58b89" title="Turns on the display of text on the LCD and the back light. ">LCD::display()</a> will wake up the screen again.</p>
<p>In the program's <code>loop</code> function we print the number of seconds since startup to the second line of the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields. ">LCD</a> display:</p>
<div class="fragment"><div class="line"><span class="keywordtype">void</span> loop() {</div>
<div class="line"> lcd.setCursor(0, 1);</div>
<div class="line"> lcd.print(millis() / 1000);</div>
</div><!-- fragment --></p>
<p>We then print the name of the button that is currently pressed:</p>
<div class="fragment"><div class="line"> lcd.setCursor(8, 1);</div>
<div class="line"> <span class="keywordtype">int</span> button = lcd.<a class="code" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292" title="Gets the next button press, release, or idle event.">getButton</a>();</div>
<div class="line"> <span class="keywordtype">int</span> button = lcd.<a class="code" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292">getButton</a>();</div>
<div class="line"> <span class="keywordflow">if</span> (button == LCD_BUTTON_LEFT)</div>
<div class="line"> lcd.print(<span class="stringliteral">&quot;LEFT&quot;</span>);</div>
<div class="line"> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (button == LCD_BUTTON_RIGHT)</div>
@@ -117,7 +118,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"> lcd.print(<span class="stringliteral">&quot; &quot;</span>);</div>
<div class="line">}</div>
</div><!-- fragment --></p>
<p>The <a class="el" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292" title="Gets the next button press, release, or idle event.">LCD::getButton()</a> function returns the key that has been pressed or released, or LCD_BUTTON_NONE if no key has been pressed or released this time through the loop.</p>
<p>The <a class="el" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292" title="Gets the next button press, release, or idle event. ">LCD::getButton()</a> function returns the key that has been pressed or released, or LCD_BUTTON_NONE if no key has been pressed or released this time through the loop.</p>
<p>The full source code for the example follows:</p>
<div class="fragment"><div class="line"><span class="comment">/*</span></div>
<div class="line"><span class="comment">This example demonstrates how to use the LCD library, which extends the</span></div>
@@ -130,7 +131,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><span class="comment">*/</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#include &lt;LCD.h&gt;</span></div>
<div class="line"><a class="code" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> lcd;</div>
<div class="line"><a class="code" href="classLCD.html">LCD</a> lcd;</div>
<div class="line"></div>
<div class="line"><span class="comment">// Note: if you are using the USBDroid and have reassigned pin D9 on the LCD shield to some</span></div>
<div class="line"><span class="comment">// other pin (e.g. A1), then you will need to initialize the shield with something like:</span></div>
@@ -138,7 +139,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><span class="comment">// See also: http://www.freetronics.com/pages/combining-the-lcd-keypad-shield-and-the-usbdroid</span></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#af9a2326d034fa159d384ec16223c924f" title="Enables the screen saver and causes it to activate after timeoutSecs of inactivity on the buttons...">enableScreenSaver</a>();</div>
<div class="line"> lcd.<a class="code" href="classLCD.html#af9a2326d034fa159d384ec16223c924f">enableScreenSaver</a>();</div>
<div class="line"> lcd.print(<span class="stringliteral">&quot;hello, world!&quot;</span>);</div>
<div class="line">}</div>
<div class="line"></div>
@@ -147,7 +148,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"> lcd.print(millis() / 1000);</div>
<div class="line"></div>
<div class="line"> lcd.setCursor(8, 1);</div>
<div class="line"> <span class="keywordtype">int</span> button = lcd.<a class="code" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292" title="Gets the next button press, release, or idle event.">getButton</a>();</div>
<div class="line"> <span class="keywordtype">int</span> button = lcd.<a class="code" href="classLCD.html#ac1e80e2603bd1cf0276c36092c416292">getButton</a>();</div>
<div class="line"> <span class="keywordflow">if</span> (button == LCD_BUTTON_LEFT)</div>
<div class="line"> lcd.print(<span class="stringliteral">&quot;LEFT&quot;</span>);</div>
<div class="line"> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (button == LCD_BUTTON_RIGHT)</div>
@@ -165,9 +166,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</div><!-- fragment --> </div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sun Sep 29 2013 09:30:46 for ArduinoLibs by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Thu Mar 12 2015 19:02:05 for ArduinoLibs by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.2
</a> 1.8.6
</small></address>
</body>
</html>