Commits

F Malpartida  committed 45d9267

Tested SR class and added performance benchmark as an example. Added Leonardo example.

  • Participants
  • Parent commits 002f995

Comments (0)

Files changed (52)

File LiquidCrystal_I2C.cpp

    expanderWrite ( _backlightval );   // reset expander and turn backlight off (Bit 8 =1)
    delay(1000);
    
-     //put the LCD into 4 bit mode
+   //put the LCD into 4 bit mode
    // this is according to the hitachi HD44780 datasheet
    // figure 24, pg 46
    
 void LiquidCrystal_I2C::pulseEnable (uint8_t _data)
 {
    expanderWrite (_data | _En);   // En HIGH
-   expanderWrite(_data & ~_En);  // En LOW
+   expanderWrite(_data & ~_En);   // En LOW
 } 
 
 //

File LiquidCrystal_SR.cpp

 // LiquidCrystal constructor is called).
 // A call to begin() will reinitialize the LCD.
 
+// STATIC helper routines
+// ---------------------------------------------------------------------------
+/*!
+ @function
+ @abstract   waits for a given time in microseconds (compilation dependent).
+ @discussion Waits for a given time defined in microseconds depending on
+ the FAST_MODE define. If the FAST_MODE is defined the call will return
+ inmediatelly.
+ @param      uSec[in] time in microseconds.
+ @result     None
+ */
+inline static void waitUsec ( uint16_t uSec )
+{
+#ifndef FAST_MODE
+   delayMicroseconds ( uSec );
+#endif // FAST_MODE
 
 // CONSTRUCTORS
 // ---------------------------------------------------------------------------
    shiftOut ( _srdata_pin, _srclock_pin, MSBFIRST, val1 );
    
    digitalWrite( _enable_pin, HIGH );
-   delayMicroseconds(1);                 // enable pulse must be >450ns
+   waitUsec( 1 );                 // enable pulse must be >450ns
    digitalWrite( _enable_pin, LOW );
 
    // clear shiftregister
    shiftOut ( _srdata_pin, _srclock_pin, MSBFIRST, val2 );
    
    digitalWrite( _enable_pin, HIGH );
-   delayMicroseconds(1);                 // enable pulse must be >450ns
+   waitUsec( 1 );                 // enable pulse must be >450ns
    digitalWrite( _enable_pin, LOW );
-   delayMicroseconds(40);                // commands need > 37us to settle
+   waitUsec( 40 );                // commands need > 37us to settle
 }
 
 //
    shiftOut ( _srdata_pin, _srclock_pin, MSBFIRST, val1 );
    
    digitalWrite( _enable_pin, HIGH );
-   delayMicroseconds(1);                 // enable pulse must be >450ns
+   waitUsec( 1 );                 // enable pulse must be >450ns
    digitalWrite( _enable_pin, LOW );
    
-   delayMicroseconds(40);               // commands need > 37us to settle
+   waitUsec( 40 );               // commands need > 37us to settle
 }
 
 

File docs/html/_i2_c_i_o_8cpp.html

 </iframe>
 </div>
 
-<hr class="footer"/><address class="footer"><small>Generated on Sat Nov 19 2011 20:59:21 for LCD Library by&#160;
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jan 6 2012 14:21:03 for LCD Library 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>

File docs/html/_i2_c_i_o_8cpp_source.html

 </iframe>
 </div>
 
-<hr class="footer"/><address class="footer"><small>Generated on Sat Nov 19 2011 20:59:21 for LCD Library by&#160;
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jan 6 2012 14:21:03 for LCD Library 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>

File docs/html/_i2_c_i_o_8h.html

 </iframe>
 </div>
 
-<hr class="footer"/><address class="footer"><small>Generated on Sat Nov 19 2011 20:59:21 for LCD Library by&#160;
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jan 6 2012 14:21:03 for LCD Library 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>

File docs/html/_i2_c_i_o_8h_source.html

 </iframe>
 </div>
 
-<hr class="footer"/><address class="footer"><small>Generated on Sat Nov 19 2011 20:59:21 for LCD Library by&#160;
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jan 6 2012 14:21:03 for LCD Library 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>

File docs/html/_l_c_d_8cpp.html

 </iframe>
 </div>
 
-<hr class="footer"/><address class="footer"><small>Generated on Sat Nov 19 2011 20:59:21 for LCD Library by&#160;
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jan 6 2012 14:21:03 for LCD Library 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>

File docs/html/_l_c_d_8cpp_source.html

 <a name="l00046"></a>00046 
 <a name="l00047"></a>00047 <span class="comment">// CLASS CONSTRUCTORS</span>
 <a name="l00048"></a>00048 <span class="comment">// ---------------------------------------------------------------------------</span>
-<a name="l00049"></a>00049 
-<a name="l00050"></a>00050 <span class="comment">// Constructor</span>
-<a name="l00051"></a><a class="code" href="class_l_c_d.html#a00bb2db1390721abc7b24ac4b8c276c8">00051</a> <a class="code" href="class_l_c_d.html#a00bb2db1390721abc7b24ac4b8c276c8">LCD::LCD</a> () 
-<a name="l00052"></a>00052 {
-<a name="l00053"></a>00053    
-<a name="l00054"></a>00054 }
-<a name="l00055"></a>00055 
-<a name="l00056"></a>00056 <span class="comment">// PUBLIC METHODS</span>
-<a name="l00057"></a>00057 <span class="comment">// ---------------------------------------------------------------------------</span>
-<a name="l00058"></a>00058 
-<a name="l00059"></a>00059 <span class="comment">// Common LCD Commands</span>
-<a name="l00060"></a>00060 <span class="comment">// ---------------------------------------------------------------------------</span>
-<a name="l00061"></a><a class="code" href="class_l_c_d.html#afa699e0beeeee03cce8cef87eba81c4a">00061</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#afa699e0beeeee03cce8cef87eba81c4a">LCD::clear</a>()
-<a name="l00062"></a>00062 {
-<a name="l00063"></a>00063    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#acc3509bc0442b41e2b816555de473ed2">LCD_CLEARDISPLAY</a>);             <span class="comment">// clear display, set cursor position to zero</span>
-<a name="l00064"></a>00064    delayMicroseconds(<a class="code" href="_l_c_d_8h.html#ad25b138788d83e67f840588754e2df2f">HOME_CLEAR_EXEC</a>);    <span class="comment">// this command is time consuming</span>
-<a name="l00065"></a>00065 }
-<a name="l00066"></a>00066 
-<a name="l00067"></a><a class="code" href="class_l_c_d.html#aee45ad37f09312f5d9982257e2d37e68">00067</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#aee45ad37f09312f5d9982257e2d37e68">LCD::home</a>()
-<a name="l00068"></a>00068 {
-<a name="l00069"></a>00069    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#a154c86a887633d0f6d9988e4dbb1f419">LCD_RETURNHOME</a>);             <span class="comment">// set cursor position to zero</span>
-<a name="l00070"></a>00070    delayMicroseconds(<a class="code" href="_l_c_d_8h.html#ad25b138788d83e67f840588754e2df2f">HOME_CLEAR_EXEC</a>);  <span class="comment">// This command is time consuming</span>
-<a name="l00071"></a>00071 }
-<a name="l00072"></a>00072 
-<a name="l00073"></a><a class="code" href="class_l_c_d.html#a48220450fd152b25994eb7d0ba340e8d">00073</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#a48220450fd152b25994eb7d0ba340e8d">LCD::setCursor</a>(uint8_t col, uint8_t row)
-<a name="l00074"></a>00074 {
-<a name="l00075"></a>00075    <span class="keywordtype">int</span> row_offsets[] = { 0x00, 0x40, 0x14, 0x54 };
+<a name="l00049"></a>00049 <span class="comment">// Constructor</span>
+<a name="l00050"></a><a class="code" href="class_l_c_d.html#a00bb2db1390721abc7b24ac4b8c276c8">00050</a> <a class="code" href="class_l_c_d.html#a00bb2db1390721abc7b24ac4b8c276c8">LCD::LCD</a> () 
+<a name="l00051"></a>00051 {
+<a name="l00052"></a>00052    
+<a name="l00053"></a>00053 }
+<a name="l00054"></a>00054 
+<a name="l00055"></a>00055 <span class="comment">// PUBLIC METHODS</span>
+<a name="l00056"></a>00056 <span class="comment">// ---------------------------------------------------------------------------</span>
+<a name="l00057"></a>00057 
+<a name="l00058"></a>00058 <span class="comment">// Common LCD Commands</span>
+<a name="l00059"></a>00059 <span class="comment">// ---------------------------------------------------------------------------</span>
+<a name="l00060"></a><a class="code" href="class_l_c_d.html#afa699e0beeeee03cce8cef87eba81c4a">00060</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#afa699e0beeeee03cce8cef87eba81c4a">LCD::clear</a>()
+<a name="l00061"></a>00061 {
+<a name="l00062"></a>00062    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#acc3509bc0442b41e2b816555de473ed2">LCD_CLEARDISPLAY</a>);             <span class="comment">// clear display, set cursor position to zero</span>
+<a name="l00063"></a>00063    delayMicroseconds(<a class="code" href="_l_c_d_8h.html#ad25b138788d83e67f840588754e2df2f">HOME_CLEAR_EXEC</a>);    <span class="comment">// this command is time consuming</span>
+<a name="l00064"></a>00064 }
+<a name="l00065"></a>00065 
+<a name="l00066"></a><a class="code" href="class_l_c_d.html#aee45ad37f09312f5d9982257e2d37e68">00066</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#aee45ad37f09312f5d9982257e2d37e68">LCD::home</a>()
+<a name="l00067"></a>00067 {
+<a name="l00068"></a>00068    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#a154c86a887633d0f6d9988e4dbb1f419">LCD_RETURNHOME</a>);             <span class="comment">// set cursor position to zero</span>
+<a name="l00069"></a>00069    delayMicroseconds(<a class="code" href="_l_c_d_8h.html#ad25b138788d83e67f840588754e2df2f">HOME_CLEAR_EXEC</a>);  <span class="comment">// This command is time consuming</span>
+<a name="l00070"></a>00070 }
+<a name="l00071"></a>00071 
+<a name="l00072"></a><a class="code" href="class_l_c_d.html#a48220450fd152b25994eb7d0ba340e8d">00072</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#a48220450fd152b25994eb7d0ba340e8d">LCD::setCursor</a>(uint8_t col, uint8_t row)
+<a name="l00073"></a>00073 {
+<a name="l00074"></a>00074    <span class="keywordtype">int</span> row_offsetsDef[]   = { 0x00, 0x40, 0x14, 0x54 }; <span class="comment">// For regular LCDs</span>
+<a name="l00075"></a>00075    <span class="keywordtype">int</span> row_offsetsLarge[] = { 0x00, 0x40, 0x10, 0x50 }; <span class="comment">// For 16x4 LCDs</span>
 <a name="l00076"></a>00076    
 <a name="l00077"></a>00077    <span class="keywordflow">if</span> ( row &gt;= <a class="code" href="class_l_c_d.html#ac1374911fb145fea430c21092ada0c06">_numlines</a> ) 
 <a name="l00078"></a>00078    {
 <a name="l00079"></a>00079       row = <a class="code" href="class_l_c_d.html#ac1374911fb145fea430c21092ada0c06">_numlines</a>-1;    <span class="comment">// rows start at 0</span>
 <a name="l00080"></a>00080    }
 <a name="l00081"></a>00081    
-<a name="l00082"></a>00082    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#a15008b832807a208d9d88c74e6751ebf">LCD_SETDDRAMADDR</a> | (col + row_offsets[row]));
-<a name="l00083"></a>00083 }
-<a name="l00084"></a>00084 
-<a name="l00085"></a>00085 <span class="comment">// Turn the display on/off</span>
-<a name="l00086"></a><a class="code" href="class_l_c_d.html#af3974da6d988ba2d21c25135ada12108">00086</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#af3974da6d988ba2d21c25135ada12108">LCD::noDisplay</a>() 
-<a name="l00087"></a>00087 {
-<a name="l00088"></a>00088    <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a> &amp;= ~<a class="code" href="_l_c_d_8h.html#a76236ae8317b34bbc98ea56bc0a2639c">LCD_DISPLAYON</a>;
-<a name="l00089"></a>00089    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#adfb8b2b8b8a08d7313504d7a4f89d99f">LCD_DISPLAYCONTROL</a> | <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a>);
-<a name="l00090"></a>00090 }
-<a name="l00091"></a>00091 
-<a name="l00092"></a><a class="code" href="class_l_c_d.html#a5b07cf05e8e5e7c53654f5ca0cf58b89">00092</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#a5b07cf05e8e5e7c53654f5ca0cf58b89">LCD::display</a>() 
-<a name="l00093"></a>00093 {
-<a name="l00094"></a>00094    <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a> |= <a class="code" href="_l_c_d_8h.html#a76236ae8317b34bbc98ea56bc0a2639c">LCD_DISPLAYON</a>;
-<a name="l00095"></a>00095    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#adfb8b2b8b8a08d7313504d7a4f89d99f">LCD_DISPLAYCONTROL</a> | <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a>);
-<a name="l00096"></a>00096 }
-<a name="l00097"></a>00097 
-<a name="l00098"></a>00098 <span class="comment">// Turns the underline cursor on/off</span>
-<a name="l00099"></a><a class="code" href="class_l_c_d.html#aec8ffaa1e69c7a6e13ac0cfbc29151d9">00099</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#aec8ffaa1e69c7a6e13ac0cfbc29151d9">LCD::noCursor</a>() 
-<a name="l00100"></a>00100 {
-<a name="l00101"></a>00101    <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a> &amp;= ~<a class="code" href="_l_c_d_8h.html#ab67f0adccde68de88eee0513fdfc4574">LCD_CURSORON</a>;
-<a name="l00102"></a>00102    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#adfb8b2b8b8a08d7313504d7a4f89d99f">LCD_DISPLAYCONTROL</a> | <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a>);
-<a name="l00103"></a>00103 }
-<a name="l00104"></a><a class="code" href="class_l_c_d.html#a194814f64dfa50a90e07e0fe0d361620">00104</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#a194814f64dfa50a90e07e0fe0d361620">LCD::cursor</a>() 
-<a name="l00105"></a>00105 {
-<a name="l00106"></a>00106    <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a> |= <a class="code" href="_l_c_d_8h.html#ab67f0adccde68de88eee0513fdfc4574">LCD_CURSORON</a>;
-<a name="l00107"></a>00107    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#adfb8b2b8b8a08d7313504d7a4f89d99f">LCD_DISPLAYCONTROL</a> | <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a>);
-<a name="l00108"></a>00108 }
-<a name="l00109"></a>00109 
-<a name="l00110"></a>00110 <span class="comment">// Turns on/off the blinking cursor</span>
-<a name="l00111"></a><a class="code" href="class_l_c_d.html#a3b755c4b397b5985752be8c30ee1a9b5">00111</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#a3b755c4b397b5985752be8c30ee1a9b5">LCD::noBlink</a>() 
-<a name="l00112"></a>00112 {
-<a name="l00113"></a>00113    <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a> &amp;= ~<a class="code" href="_l_c_d_8h.html#ac3b19d4e6553b9bbf18a23387e439206">LCD_BLINKON</a>;
-<a name="l00114"></a>00114    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#adfb8b2b8b8a08d7313504d7a4f89d99f">LCD_DISPLAYCONTROL</a> | <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a>);
-<a name="l00115"></a>00115 }
-<a name="l00116"></a>00116 
-<a name="l00117"></a><a class="code" href="class_l_c_d.html#a878b36878fa8287093964eba83aace77">00117</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#a878b36878fa8287093964eba83aace77">LCD::blink</a>() 
-<a name="l00118"></a>00118 {
-<a name="l00119"></a>00119    <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a> |= <a class="code" href="_l_c_d_8h.html#ac3b19d4e6553b9bbf18a23387e439206">LCD_BLINKON</a>;
-<a name="l00120"></a>00120    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#adfb8b2b8b8a08d7313504d7a4f89d99f">LCD_DISPLAYCONTROL</a> | <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a>);
-<a name="l00121"></a>00121 }
-<a name="l00122"></a>00122 
-<a name="l00123"></a>00123 <span class="comment">// These commands scroll the display without changing the RAM</span>
-<a name="l00124"></a><a class="code" href="class_l_c_d.html#a6f3a503055b3b8dcf0f61b2633c584f7">00124</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#a6f3a503055b3b8dcf0f61b2633c584f7">LCD::scrollDisplayLeft</a>(<span class="keywordtype">void</span>) 
-<a name="l00125"></a>00125 {
-<a name="l00126"></a>00126    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#a61f16a2b7550e4700f7898a7587c5594">LCD_CURSORSHIFT</a> | <a class="code" href="_l_c_d_8h.html#ab2f7b67abfac33f610acfd5d7a971f40">LCD_DISPLAYMOVE</a> | <a class="code" href="_l_c_d_8h.html#aafb86adb0dfca1e65d65b2cd1946a009">LCD_MOVELEFT</a>);
-<a name="l00127"></a>00127 }
-<a name="l00128"></a>00128 
-<a name="l00129"></a><a class="code" href="class_l_c_d.html#abfc44b294772f09020bfa32af8a79571">00129</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#abfc44b294772f09020bfa32af8a79571">LCD::scrollDisplayRight</a>(<span class="keywordtype">void</span>) {
-<a name="l00130"></a>00130    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#a61f16a2b7550e4700f7898a7587c5594">LCD_CURSORSHIFT</a> | <a class="code" href="_l_c_d_8h.html#ab2f7b67abfac33f610acfd5d7a971f40">LCD_DISPLAYMOVE</a> | <a class="code" href="_l_c_d_8h.html#acf5999180233790bb2c9902efde58f7f">LCD_MOVERIGHT</a>);
+<a name="l00082"></a>00082    <span class="comment">// 16x4 LCDs have special memory map layout</span>
+<a name="l00083"></a>00083    <span class="comment">// ----------------------------------------</span>
+<a name="l00084"></a>00084    <span class="keywordflow">if</span> ( <a class="code" href="class_l_c_d.html#a88b16ea0e5c7d1cabc5007d48bcbd2b0">_cols</a> == 16 &amp;&amp; <a class="code" href="class_l_c_d.html#ac1374911fb145fea430c21092ada0c06">_numlines</a> == 4 )
+<a name="l00085"></a>00085    {
+<a name="l00086"></a>00086       <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#a15008b832807a208d9d88c74e6751ebf">LCD_SETDDRAMADDR</a> | (col + row_offsetsLarge[row]));
+<a name="l00087"></a>00087    }
+<a name="l00088"></a>00088    <span class="keywordflow">else</span> 
+<a name="l00089"></a>00089    {
+<a name="l00090"></a>00090       <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#a15008b832807a208d9d88c74e6751ebf">LCD_SETDDRAMADDR</a> | (col + row_offsetsDef[row]));
+<a name="l00091"></a>00091    }
+<a name="l00092"></a>00092 
+<a name="l00093"></a>00093 }
+<a name="l00094"></a>00094 
+<a name="l00095"></a>00095 <span class="comment">// Turn the display on/off</span>
+<a name="l00096"></a><a class="code" href="class_l_c_d.html#af3974da6d988ba2d21c25135ada12108">00096</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#af3974da6d988ba2d21c25135ada12108">LCD::noDisplay</a>() 
+<a name="l00097"></a>00097 {
+<a name="l00098"></a>00098    <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a> &amp;= ~<a class="code" href="_l_c_d_8h.html#a76236ae8317b34bbc98ea56bc0a2639c">LCD_DISPLAYON</a>;
+<a name="l00099"></a>00099    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#adfb8b2b8b8a08d7313504d7a4f89d99f">LCD_DISPLAYCONTROL</a> | <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a>);
+<a name="l00100"></a>00100 }
+<a name="l00101"></a>00101 
+<a name="l00102"></a><a class="code" href="class_l_c_d.html#a5b07cf05e8e5e7c53654f5ca0cf58b89">00102</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#a5b07cf05e8e5e7c53654f5ca0cf58b89">LCD::display</a>() 
+<a name="l00103"></a>00103 {
+<a name="l00104"></a>00104    <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a> |= <a class="code" href="_l_c_d_8h.html#a76236ae8317b34bbc98ea56bc0a2639c">LCD_DISPLAYON</a>;
+<a name="l00105"></a>00105    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#adfb8b2b8b8a08d7313504d7a4f89d99f">LCD_DISPLAYCONTROL</a> | <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a>);
+<a name="l00106"></a>00106 }
+<a name="l00107"></a>00107 
+<a name="l00108"></a>00108 <span class="comment">// Turns the underline cursor on/off</span>
+<a name="l00109"></a><a class="code" href="class_l_c_d.html#aec8ffaa1e69c7a6e13ac0cfbc29151d9">00109</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#aec8ffaa1e69c7a6e13ac0cfbc29151d9">LCD::noCursor</a>() 
+<a name="l00110"></a>00110 {
+<a name="l00111"></a>00111    <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a> &amp;= ~<a class="code" href="_l_c_d_8h.html#ab67f0adccde68de88eee0513fdfc4574">LCD_CURSORON</a>;
+<a name="l00112"></a>00112    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#adfb8b2b8b8a08d7313504d7a4f89d99f">LCD_DISPLAYCONTROL</a> | <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a>);
+<a name="l00113"></a>00113 }
+<a name="l00114"></a><a class="code" href="class_l_c_d.html#a194814f64dfa50a90e07e0fe0d361620">00114</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#a194814f64dfa50a90e07e0fe0d361620">LCD::cursor</a>() 
+<a name="l00115"></a>00115 {
+<a name="l00116"></a>00116    <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a> |= <a class="code" href="_l_c_d_8h.html#ab67f0adccde68de88eee0513fdfc4574">LCD_CURSORON</a>;
+<a name="l00117"></a>00117    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#adfb8b2b8b8a08d7313504d7a4f89d99f">LCD_DISPLAYCONTROL</a> | <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a>);
+<a name="l00118"></a>00118 }
+<a name="l00119"></a>00119 
+<a name="l00120"></a>00120 <span class="comment">// Turns on/off the blinking cursor</span>
+<a name="l00121"></a><a class="code" href="class_l_c_d.html#a3b755c4b397b5985752be8c30ee1a9b5">00121</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#a3b755c4b397b5985752be8c30ee1a9b5">LCD::noBlink</a>() 
+<a name="l00122"></a>00122 {
+<a name="l00123"></a>00123    <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a> &amp;= ~<a class="code" href="_l_c_d_8h.html#ac3b19d4e6553b9bbf18a23387e439206">LCD_BLINKON</a>;
+<a name="l00124"></a>00124    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#adfb8b2b8b8a08d7313504d7a4f89d99f">LCD_DISPLAYCONTROL</a> | <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a>);
+<a name="l00125"></a>00125 }
+<a name="l00126"></a>00126 
+<a name="l00127"></a><a class="code" href="class_l_c_d.html#a878b36878fa8287093964eba83aace77">00127</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#a878b36878fa8287093964eba83aace77">LCD::blink</a>() 
+<a name="l00128"></a>00128 {
+<a name="l00129"></a>00129    <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a> |= <a class="code" href="_l_c_d_8h.html#ac3b19d4e6553b9bbf18a23387e439206">LCD_BLINKON</a>;
+<a name="l00130"></a>00130    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#adfb8b2b8b8a08d7313504d7a4f89d99f">LCD_DISPLAYCONTROL</a> | <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a>);
 <a name="l00131"></a>00131 }
 <a name="l00132"></a>00132 
-<a name="l00133"></a>00133 <span class="comment">// This is for text that flows Left to Right</span>
-<a name="l00134"></a><a class="code" href="class_l_c_d.html#a238e9f6476dc7df64af04eb6c87f6ac7">00134</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#a238e9f6476dc7df64af04eb6c87f6ac7">LCD::leftToRight</a>(<span class="keywordtype">void</span>) 
+<a name="l00133"></a>00133 <span class="comment">// These commands scroll the display without changing the RAM</span>
+<a name="l00134"></a><a class="code" href="class_l_c_d.html#a6f3a503055b3b8dcf0f61b2633c584f7">00134</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#a6f3a503055b3b8dcf0f61b2633c584f7">LCD::scrollDisplayLeft</a>(<span class="keywordtype">void</span>) 
 <a name="l00135"></a>00135 {
-<a name="l00136"></a>00136    <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a> |= <a class="code" href="_l_c_d_8h.html#ae7c6309fce6200bd7526d090a4a84dd0">LCD_ENTRYLEFT</a>;
-<a name="l00137"></a>00137    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#a5597e1d5819ea2f0734ad4313abf6703">LCD_ENTRYMODESET</a> | <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a>);
-<a name="l00138"></a>00138 }
-<a name="l00139"></a>00139 
-<a name="l00140"></a>00140 <span class="comment">// This is for text that flows Right to Left</span>
-<a name="l00141"></a><a class="code" href="class_l_c_d.html#ac014830eadc26bfd86308ea8734f4428">00141</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#ac014830eadc26bfd86308ea8734f4428">LCD::rightToLeft</a>(<span class="keywordtype">void</span>) 
-<a name="l00142"></a>00142 {
-<a name="l00143"></a>00143    <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a> &amp;= ~<a class="code" href="_l_c_d_8h.html#ae7c6309fce6200bd7526d090a4a84dd0">LCD_ENTRYLEFT</a>;
-<a name="l00144"></a>00144    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#a5597e1d5819ea2f0734ad4313abf6703">LCD_ENTRYMODESET</a> | <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a>);
-<a name="l00145"></a>00145 }
-<a name="l00146"></a>00146 
-<a name="l00147"></a>00147 <span class="comment">// This will &#39;right justify&#39; text from the cursor</span>
-<a name="l00148"></a><a class="code" href="class_l_c_d.html#abb3ed88d530f6283e6159b4973e7da9e">00148</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#abb3ed88d530f6283e6159b4973e7da9e">LCD::autoscroll</a>(<span class="keywordtype">void</span>) 
-<a name="l00149"></a>00149 {
-<a name="l00150"></a>00150    <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a> |= <a class="code" href="_l_c_d_8h.html#aa2cf1d0f4a319e53c009cffe1184466c">LCD_ENTRYSHIFTINCREMENT</a>;
-<a name="l00151"></a>00151    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#a5597e1d5819ea2f0734ad4313abf6703">LCD_ENTRYMODESET</a> | <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a>);
-<a name="l00152"></a>00152 }
-<a name="l00153"></a>00153 
-<a name="l00154"></a>00154 <span class="comment">// This will &#39;left justify&#39; text from the cursor</span>
-<a name="l00155"></a><a class="code" href="class_l_c_d.html#a96035dde40efbf73390e00b5beb00231">00155</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#a96035dde40efbf73390e00b5beb00231">LCD::noAutoscroll</a>(<span class="keywordtype">void</span>) 
-<a name="l00156"></a>00156 {
-<a name="l00157"></a>00157    <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a> &amp;= ~<a class="code" href="_l_c_d_8h.html#aa2cf1d0f4a319e53c009cffe1184466c">LCD_ENTRYSHIFTINCREMENT</a>;
-<a name="l00158"></a>00158    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#a5597e1d5819ea2f0734ad4313abf6703">LCD_ENTRYMODESET</a> | <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a>);
-<a name="l00159"></a>00159 }
-<a name="l00160"></a>00160 
-<a name="l00161"></a>00161 <span class="comment">// Write to CGRAM of new characters</span>
-<a name="l00162"></a><a class="code" href="class_l_c_d.html#a91cba8f93c692abcddf8bc3de58d2d3a">00162</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#a91cba8f93c692abcddf8bc3de58d2d3a">LCD::createChar</a>(uint8_t location, uint8_t charmap[]) 
-<a name="l00163"></a>00163 {
-<a name="l00164"></a>00164    location &amp;= 0x7;            <span class="comment">// we only have 8 locations 0-7</span>
-<a name="l00165"></a>00165    
-<a name="l00166"></a>00166    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#aae6ea856879c11dee58493184582a52f">LCD_SETCGRAMADDR</a> | (location &lt;&lt; 3));
-<a name="l00167"></a>00167    
-<a name="l00168"></a>00168    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0; i&lt;8; i++) 
-<a name="l00169"></a>00169    {
-<a name="l00170"></a>00170       <a class="code" href="class_l_c_d.html#a2d89cc2e62f72afb5f15a7fd812900e3">write</a>(charmap[i]);      <span class="comment">// call the virtual write method</span>
-<a name="l00171"></a>00171    }
-<a name="l00172"></a>00172 }
-<a name="l00173"></a>00173 
-<a name="l00174"></a>00174 <span class="comment">// General LCD commands - generic methods used by the rest of the commands</span>
-<a name="l00175"></a>00175 <span class="comment">// ---------------------------------------------------------------------------</span>
-<a name="l00176"></a><a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">00176</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">LCD::command</a>(uint8_t value) 
-<a name="l00177"></a>00177 {
-<a name="l00178"></a>00178    <a class="code" href="class_l_c_d.html#a8a5b6f6f448a6ca6eeb3466c370d47ab">send</a>(value, <a class="code" href="_l_c_d_8h.html#ab0d87e07831e7e4943caef187872123e">COMMAND</a>);
-<a name="l00179"></a>00179 }
-<a name="l00180"></a>00180 
-<a name="l00181"></a>00181 <span class="preprocessor">#if (ARDUINO &lt;  100)</span>
-<a name="l00182"></a><a class="code" href="class_l_c_d.html#a2d89cc2e62f72afb5f15a7fd812900e3">00182</a> <span class="preprocessor"></span><span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#a2d89cc2e62f72afb5f15a7fd812900e3">LCD::write</a>(uint8_t value)
-<a name="l00183"></a>00183 {
-<a name="l00184"></a>00184    <a class="code" href="class_l_c_d.html#a8a5b6f6f448a6ca6eeb3466c370d47ab">send</a>(value, <a class="code" href="_l_c_d_8h.html#aad9ae913bdfab20dd94ad04ee2d5b045">DATA</a>);
-<a name="l00185"></a>00185 }
-<a name="l00186"></a>00186 <span class="preprocessor">#else</span>
-<a name="l00187"></a>00187 <span class="preprocessor"></span><span class="keywordtype">size_t</span> <a class="code" href="class_l_c_d.html#a2d89cc2e62f72afb5f15a7fd812900e3">LCD::write</a>(uint8_t value) 
-<a name="l00188"></a>00188 {
-<a name="l00189"></a>00189    <a class="code" href="class_l_c_d.html#a8a5b6f6f448a6ca6eeb3466c370d47ab">send</a>(value, <a class="code" href="_l_c_d_8h.html#aad9ae913bdfab20dd94ad04ee2d5b045">DATA</a>);
-<a name="l00190"></a>00190    <span class="keywordflow">return</span> 1;             <span class="comment">// assume OK</span>
-<a name="l00191"></a>00191 }
-<a name="l00192"></a>00192 <span class="preprocessor">#endif</span>
+<a name="l00136"></a>00136    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#a61f16a2b7550e4700f7898a7587c5594">LCD_CURSORSHIFT</a> | <a class="code" href="_l_c_d_8h.html#ab2f7b67abfac33f610acfd5d7a971f40">LCD_DISPLAYMOVE</a> | <a class="code" href="_l_c_d_8h.html#aafb86adb0dfca1e65d65b2cd1946a009">LCD_MOVELEFT</a>);
+<a name="l00137"></a>00137 }
+<a name="l00138"></a>00138 
+<a name="l00139"></a><a class="code" href="class_l_c_d.html#abfc44b294772f09020bfa32af8a79571">00139</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#abfc44b294772f09020bfa32af8a79571">LCD::scrollDisplayRight</a>(<span class="keywordtype">void</span>) {
+<a name="l00140"></a>00140    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#a61f16a2b7550e4700f7898a7587c5594">LCD_CURSORSHIFT</a> | <a class="code" href="_l_c_d_8h.html#ab2f7b67abfac33f610acfd5d7a971f40">LCD_DISPLAYMOVE</a> | <a class="code" href="_l_c_d_8h.html#acf5999180233790bb2c9902efde58f7f">LCD_MOVERIGHT</a>);
+<a name="l00141"></a>00141 }
+<a name="l00142"></a>00142 
+<a name="l00143"></a>00143 <span class="comment">// This is for text that flows Left to Right</span>
+<a name="l00144"></a><a class="code" href="class_l_c_d.html#a238e9f6476dc7df64af04eb6c87f6ac7">00144</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#a238e9f6476dc7df64af04eb6c87f6ac7">LCD::leftToRight</a>(<span class="keywordtype">void</span>) 
+<a name="l00145"></a>00145 {
+<a name="l00146"></a>00146    <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a> |= <a class="code" href="_l_c_d_8h.html#ae7c6309fce6200bd7526d090a4a84dd0">LCD_ENTRYLEFT</a>;
+<a name="l00147"></a>00147    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#a5597e1d5819ea2f0734ad4313abf6703">LCD_ENTRYMODESET</a> | <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a>);
+<a name="l00148"></a>00148 }
+<a name="l00149"></a>00149 
+<a name="l00150"></a>00150 <span class="comment">// This is for text that flows Right to Left</span>
+<a name="l00151"></a><a class="code" href="class_l_c_d.html#ac014830eadc26bfd86308ea8734f4428">00151</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#ac014830eadc26bfd86308ea8734f4428">LCD::rightToLeft</a>(<span class="keywordtype">void</span>) 
+<a name="l00152"></a>00152 {
+<a name="l00153"></a>00153    <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a> &amp;= ~<a class="code" href="_l_c_d_8h.html#ae7c6309fce6200bd7526d090a4a84dd0">LCD_ENTRYLEFT</a>;
+<a name="l00154"></a>00154    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#a5597e1d5819ea2f0734ad4313abf6703">LCD_ENTRYMODESET</a> | <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a>);
+<a name="l00155"></a>00155 }
+<a name="l00156"></a>00156 
+<a name="l00157"></a>00157 <span class="comment">// This will &#39;right justify&#39; text from the cursor</span>
+<a name="l00158"></a><a class="code" href="class_l_c_d.html#abb3ed88d530f6283e6159b4973e7da9e">00158</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#abb3ed88d530f6283e6159b4973e7da9e">LCD::autoscroll</a>(<span class="keywordtype">void</span>) 
+<a name="l00159"></a>00159 {
+<a name="l00160"></a>00160    <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a> |= <a class="code" href="_l_c_d_8h.html#aa2cf1d0f4a319e53c009cffe1184466c">LCD_ENTRYSHIFTINCREMENT</a>;
+<a name="l00161"></a>00161    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#a5597e1d5819ea2f0734ad4313abf6703">LCD_ENTRYMODESET</a> | <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a>);
+<a name="l00162"></a>00162 }
+<a name="l00163"></a>00163 
+<a name="l00164"></a>00164 <span class="comment">// This will &#39;left justify&#39; text from the cursor</span>
+<a name="l00165"></a><a class="code" href="class_l_c_d.html#a96035dde40efbf73390e00b5beb00231">00165</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#a96035dde40efbf73390e00b5beb00231">LCD::noAutoscroll</a>(<span class="keywordtype">void</span>) 
+<a name="l00166"></a>00166 {
+<a name="l00167"></a>00167    <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a> &amp;= ~<a class="code" href="_l_c_d_8h.html#aa2cf1d0f4a319e53c009cffe1184466c">LCD_ENTRYSHIFTINCREMENT</a>;
+<a name="l00168"></a>00168    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#a5597e1d5819ea2f0734ad4313abf6703">LCD_ENTRYMODESET</a> | <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a>);
+<a name="l00169"></a>00169 }
+<a name="l00170"></a>00170 
+<a name="l00171"></a>00171 <span class="comment">// Write to CGRAM of new characters</span>
+<a name="l00172"></a><a class="code" href="class_l_c_d.html#a91cba8f93c692abcddf8bc3de58d2d3a">00172</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#a91cba8f93c692abcddf8bc3de58d2d3a">LCD::createChar</a>(uint8_t location, uint8_t charmap[]) 
+<a name="l00173"></a>00173 {
+<a name="l00174"></a>00174    location &amp;= 0x7;            <span class="comment">// we only have 8 locations 0-7</span>
+<a name="l00175"></a>00175    
+<a name="l00176"></a>00176    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#aae6ea856879c11dee58493184582a52f">LCD_SETCGRAMADDR</a> | (location &lt;&lt; 3));
+<a name="l00177"></a>00177    
+<a name="l00178"></a>00178    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0; i&lt;8; i++) 
+<a name="l00179"></a>00179    {
+<a name="l00180"></a>00180       <a class="code" href="class_l_c_d.html#a2d89cc2e62f72afb5f15a7fd812900e3">write</a>(charmap[i]);      <span class="comment">// call the virtual write method</span>
+<a name="l00181"></a>00181    }
+<a name="l00182"></a>00182 }
+<a name="l00183"></a>00183 
+<a name="l00184"></a>00184 <span class="comment">// General LCD commands - generic methods used by the rest of the commands</span>
+<a name="l00185"></a>00185 <span class="comment">// ---------------------------------------------------------------------------</span>
+<a name="l00186"></a><a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">00186</a> <span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">LCD::command</a>(uint8_t value) 
+<a name="l00187"></a>00187 {
+<a name="l00188"></a>00188    <a class="code" href="class_l_c_d.html#a8a5b6f6f448a6ca6eeb3466c370d47ab">send</a>(value, <a class="code" href="_l_c_d_8h.html#ab0d87e07831e7e4943caef187872123e">COMMAND</a>);
+<a name="l00189"></a>00189 }
+<a name="l00190"></a>00190 
+<a name="l00191"></a>00191 <span class="preprocessor">#if (ARDUINO &lt;  100)</span>
+<a name="l00192"></a><a class="code" href="class_l_c_d.html#a2d89cc2e62f72afb5f15a7fd812900e3">00192</a> <span class="preprocessor"></span><span class="keywordtype">void</span> <a class="code" href="class_l_c_d.html#a2d89cc2e62f72afb5f15a7fd812900e3">LCD::write</a>(uint8_t value)
+<a name="l00193"></a>00193 {
+<a name="l00194"></a>00194    <a class="code" href="class_l_c_d.html#a8a5b6f6f448a6ca6eeb3466c370d47ab">send</a>(value, <a class="code" href="_l_c_d_8h.html#aad9ae913bdfab20dd94ad04ee2d5b045">DATA</a>);
+<a name="l00195"></a>00195 }
+<a name="l00196"></a>00196 <span class="preprocessor">#else</span>
+<a name="l00197"></a>00197 <span class="preprocessor"></span><span class="keywordtype">size_t</span> <a class="code" href="class_l_c_d.html#a2d89cc2e62f72afb5f15a7fd812900e3">LCD::write</a>(uint8_t value) 
+<a name="l00198"></a>00198 {
+<a name="l00199"></a>00199    <a class="code" href="class_l_c_d.html#a8a5b6f6f448a6ca6eeb3466c370d47ab">send</a>(value, <a class="code" href="_l_c_d_8h.html#aad9ae913bdfab20dd94ad04ee2d5b045">DATA</a>);
+<a name="l00200"></a>00200    <span class="keywordflow">return</span> 1;             <span class="comment">// assume OK</span>
+<a name="l00201"></a>00201 }
+<a name="l00202"></a>00202 <span class="preprocessor">#endif</span>
 </pre></div></div>
 </div>
 <!-- window showing the filter options -->
 </iframe>
 </div>
 
-<hr class="footer"/><address class="footer"><small>Generated on Sat Nov 19 2011 20:59:21 for LCD Library by&#160;
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jan 6 2012 14:21:03 for LCD Library 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>

File docs/html/_l_c_d_8h.html

 </iframe>
 </div>
 
-<hr class="footer"/><address class="footer"><small>Generated on Sat Nov 19 2011 20:59:21 for LCD Library by&#160;
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jan 6 2012 14:21:03 for LCD Library 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>

File docs/html/_l_c_d_8h_source.html

 <a name="l00393"></a>00393    <span class="comment">// all commands are &quot;ored&quot; to its contents.</span>
 <a name="l00394"></a><a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">00394</a>    uint8_t <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a>;      <span class="comment">// Text entry mode to the LCD</span>
 <a name="l00395"></a><a class="code" href="class_l_c_d.html#ac1374911fb145fea430c21092ada0c06">00395</a>    uint8_t <a class="code" href="class_l_c_d.html#ac1374911fb145fea430c21092ada0c06">_numlines</a>;         <span class="comment">// Number of lines of the LCD, initialized with begin()</span>
-<a name="l00396"></a>00396    
-<a name="l00397"></a>00397 <span class="keyword">private</span>:
-<a name="l00398"></a>00398    
-<a name="l00399"></a>00399 };
-<a name="l00400"></a>00400 
-<a name="l00401"></a>00401 <span class="preprocessor">#endif</span>
+<a name="l00396"></a><a class="code" href="class_l_c_d.html#a88b16ea0e5c7d1cabc5007d48bcbd2b0">00396</a>    uint8_t <a class="code" href="class_l_c_d.html#a88b16ea0e5c7d1cabc5007d48bcbd2b0">_cols</a>;             <span class="comment">// Number of columns in the LCD</span>
+<a name="l00397"></a>00397    
+<a name="l00398"></a>00398 <span class="keyword">private</span>:
+<a name="l00399"></a>00399    
+<a name="l00400"></a>00400 };
+<a name="l00401"></a>00401 
+<a name="l00402"></a>00402 <span class="preprocessor">#endif</span>
 </pre></div></div>
 </div>
 <!-- window showing the filter options -->
 </iframe>
 </div>
 
-<hr class="footer"/><address class="footer"><small>Generated on Sat Nov 19 2011 20:59:21 for LCD Library by&#160;
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jan 6 2012 14:21:03 for LCD Library 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>

File docs/html/_liquid_crystal_8cpp.html

 </iframe>
 </div>
 
-<hr class="footer"/><address class="footer"><small>Generated on Sat Nov 19 2011 20:59:21 for LCD Library by&#160;
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jan 6 2012 14:21:03 for LCD Library 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>

File docs/html/_liquid_crystal_8cpp_source.html

 <a name="l00180"></a>00180       <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a> |= <a class="code" href="_l_c_d_8h.html#a7987e93538df2819583ba43b81ddbb25">LCD_2LINE</a>;
 <a name="l00181"></a>00181    }
 <a name="l00182"></a>00182    <a class="code" href="class_l_c_d.html#ac1374911fb145fea430c21092ada0c06">_numlines</a> = lines;
-<a name="l00183"></a>00183    
-<a name="l00184"></a>00184    <span class="comment">// for some 1 line displays you can select a 10 pixel high font</span>
-<a name="l00185"></a>00185    <span class="comment">// ------------------------------------------------------------</span>
-<a name="l00186"></a>00186    <span class="keywordflow">if</span> ((dotsize != 0) &amp;&amp; (lines == 1)) 
-<a name="l00187"></a>00187    {
-<a name="l00188"></a>00188       <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a> |= <a class="code" href="_l_c_d_8h.html#abb3210156d88d3fe18c9352eb161fe42">LCD_5x10DOTS</a>;
-<a name="l00189"></a>00189    }
-<a name="l00190"></a>00190    
-<a name="l00191"></a>00191    <span class="comment">// SEE PAGE 45/46 FOR INITIALIZATION SPECIFICATION!</span>
-<a name="l00192"></a>00192    <span class="comment">// according to datasheet, we need at least 40ms after power rises above 2.7V</span>
-<a name="l00193"></a>00193    <span class="comment">// before sending commands. Arduino can turn on way before 4.5V so we&#39;ll wait </span>
-<a name="l00194"></a>00194    <span class="comment">// 50</span>
-<a name="l00195"></a>00195    <span class="comment">// ---------------------------------------------------------------------------</span>
-<a name="l00196"></a>00196    delayMicroseconds(50000); 
-<a name="l00197"></a>00197    
-<a name="l00198"></a>00198    <span class="comment">// Now we pull both RS and R/W low to begin commands</span>
-<a name="l00199"></a>00199    digitalWrite(_rs_pin, LOW);
-<a name="l00200"></a>00200    digitalWrite(_enable_pin, LOW);
-<a name="l00201"></a>00201    
-<a name="l00202"></a>00202    <span class="keywordflow">if</span> (_rw_pin != 255) 
-<a name="l00203"></a>00203    { 
-<a name="l00204"></a>00204       digitalWrite(_rw_pin, LOW);
-<a name="l00205"></a>00205    }
-<a name="l00206"></a>00206    
-<a name="l00207"></a>00207    <span class="comment">//put the LCD into 4 bit or 8 bit mode</span>
-<a name="l00208"></a>00208    <span class="comment">// -------------------------------------</span>
-<a name="l00209"></a>00209    <span class="keywordflow">if</span> (! (<a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a> &amp; <a class="code" href="_l_c_d_8h.html#a59a57ca857dae5d89eb5f2a38c4ac6f0">LCD_8BITMODE</a>)) 
-<a name="l00210"></a>00210    {
-<a name="l00211"></a>00211       <span class="comment">// this is according to the hitachi HD44780 datasheet</span>
-<a name="l00212"></a>00212       <span class="comment">// figure 24, pg 46</span>
-<a name="l00213"></a>00213       
-<a name="l00214"></a>00214       <span class="comment">// we start in 8bit mode, try to set 4 bit mode</span>
-<a name="l00215"></a>00215       write4bits(0x03);
-<a name="l00216"></a>00216       delayMicroseconds(4500); <span class="comment">// wait min 4.1ms</span>
-<a name="l00217"></a>00217       
-<a name="l00218"></a>00218       <span class="comment">// second try</span>
-<a name="l00219"></a>00219       write4bits(0x03);
-<a name="l00220"></a>00220       delayMicroseconds(4500); <span class="comment">// wait min 4.1ms</span>
-<a name="l00221"></a>00221       
-<a name="l00222"></a>00222       <span class="comment">// third go!</span>
-<a name="l00223"></a>00223       write4bits(0x03); 
-<a name="l00224"></a>00224       delayMicroseconds(150);
-<a name="l00225"></a>00225       
-<a name="l00226"></a>00226       <span class="comment">// finally, set to 4-bit interface</span>
-<a name="l00227"></a>00227       write4bits(0x02); 
-<a name="l00228"></a>00228    } 
-<a name="l00229"></a>00229    <span class="keywordflow">else</span> 
-<a name="l00230"></a>00230    {
-<a name="l00231"></a>00231       <span class="comment">// this is according to the hitachi HD44780 datasheet</span>
-<a name="l00232"></a>00232       <span class="comment">// page 45 figure 23</span>
-<a name="l00233"></a>00233       
-<a name="l00234"></a>00234       <span class="comment">// Send function set command sequence</span>
-<a name="l00235"></a>00235       <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#aaef882ae70d1f485cd132815d9716111">LCD_FUNCTIONSET</a> | <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a>);
-<a name="l00236"></a>00236       delayMicroseconds(4500);  <span class="comment">// wait more than 4.1ms</span>
-<a name="l00237"></a>00237       
-<a name="l00238"></a>00238       <span class="comment">// second try</span>
-<a name="l00239"></a>00239       <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#aaef882ae70d1f485cd132815d9716111">LCD_FUNCTIONSET</a> | <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a>);
-<a name="l00240"></a>00240       delayMicroseconds(150);
-<a name="l00241"></a>00241       
-<a name="l00242"></a>00242       <span class="comment">// third go</span>
-<a name="l00243"></a>00243       <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#aaef882ae70d1f485cd132815d9716111">LCD_FUNCTIONSET</a> | <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a>);
-<a name="l00244"></a>00244    }
-<a name="l00245"></a>00245    
-<a name="l00246"></a>00246    <span class="comment">// finally, set # lines, font size, etc.</span>
-<a name="l00247"></a>00247    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#aaef882ae70d1f485cd132815d9716111">LCD_FUNCTIONSET</a> | <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a>);  
-<a name="l00248"></a>00248    
-<a name="l00249"></a>00249    <span class="comment">// turn the display on with no cursor or blinking default</span>
-<a name="l00250"></a>00250    <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a> = <a class="code" href="_l_c_d_8h.html#a76236ae8317b34bbc98ea56bc0a2639c">LCD_DISPLAYON</a> | <a class="code" href="_l_c_d_8h.html#a32b194a3adaa0a0bb69acee2e6a754fa">LCD_CURSOROFF</a> | <a class="code" href="_l_c_d_8h.html#a4b28243034cec656b0ed490ba6979752">LCD_BLINKOFF</a>;  
-<a name="l00251"></a>00251    <a class="code" href="class_l_c_d.html#a5b07cf05e8e5e7c53654f5ca0cf58b89">display</a>();
-<a name="l00252"></a>00252    
-<a name="l00253"></a>00253    <span class="comment">// clear the LCD</span>
-<a name="l00254"></a>00254    <a class="code" href="class_l_c_d.html#afa699e0beeeee03cce8cef87eba81c4a">clear</a>();
-<a name="l00255"></a>00255    
-<a name="l00256"></a>00256    <span class="comment">// Initialize to default text direction (for romance languages)</span>
-<a name="l00257"></a>00257    <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a> = <a class="code" href="_l_c_d_8h.html#ae7c6309fce6200bd7526d090a4a84dd0">LCD_ENTRYLEFT</a> | <a class="code" href="_l_c_d_8h.html#a049ee97e98d04788c1da9a55590fbe42">LCD_ENTRYSHIFTDECREMENT</a>;
-<a name="l00258"></a>00258    <span class="comment">// set the entry mode</span>
-<a name="l00259"></a>00259    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#a5597e1d5819ea2f0734ad4313abf6703">LCD_ENTRYMODESET</a> | <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a>);
-<a name="l00260"></a>00260    
-<a name="l00261"></a>00261 }
-<a name="l00262"></a>00262 
-<a name="l00263"></a>00263 <span class="comment">/************ low level data pushing commands **********/</span>
-<a name="l00264"></a>00264 
-<a name="l00265"></a>00265 <span class="comment">// send</span>
-<a name="l00266"></a><a class="code" href="class_liquid_crystal.html#a56142f8b3753bedd133e4139e5eb5089">00266</a> <span class="keywordtype">void</span> <a class="code" href="class_liquid_crystal.html#a56142f8b3753bedd133e4139e5eb5089">LiquidCrystal::send</a>(uint8_t value, uint8_t mode) 
-<a name="l00267"></a>00267 {
-<a name="l00268"></a>00268    digitalWrite( _rs_pin, mode );
-<a name="l00269"></a>00269    
-<a name="l00270"></a>00270    <span class="comment">// if there is a RW pin indicated, set it low to Write</span>
-<a name="l00271"></a>00271    <span class="comment">// ---------------------------------------------------</span>
-<a name="l00272"></a>00272    <span class="keywordflow">if</span> (_rw_pin != 255) 
-<a name="l00273"></a>00273    { 
-<a name="l00274"></a>00274       digitalWrite(_rw_pin, LOW);
-<a name="l00275"></a>00275    }
-<a name="l00276"></a>00276    
-<a name="l00277"></a>00277    <span class="keywordflow">if</span> (<a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a> &amp; <a class="code" href="_l_c_d_8h.html#a59a57ca857dae5d89eb5f2a38c4ac6f0">LCD_8BITMODE</a>)
-<a name="l00278"></a>00278    {
-<a name="l00279"></a>00279       write8bits(value); 
-<a name="l00280"></a>00280    } 
-<a name="l00281"></a>00281    <span class="keywordflow">else</span> 
-<a name="l00282"></a>00282    {
-<a name="l00283"></a>00283       write4bits ( value &gt;&gt; 4 );
-<a name="l00284"></a>00284       write4bits ( value );
-<a name="l00285"></a>00285    }
-<a name="l00286"></a>00286    <a class="code" href="_liquid_crystal_8cpp.html#a6eac41e4be58d7736ac0c19de225c0dc">waitUsec</a> ( <a class="code" href="_liquid_crystal_8h.html#adebff0f00a59c9f9863bc196938d5726">EXEC_TIME</a> );
-<a name="l00287"></a>00287 }
-<a name="l00288"></a>00288 
-<a name="l00289"></a>00289 <span class="comment">//</span>
-<a name="l00290"></a>00290 <span class="comment">// pulseEnable</span>
-<a name="l00291"></a>00291 <span class="keywordtype">void</span> LiquidCrystal::pulseEnable(<span class="keywordtype">void</span>) 
-<a name="l00292"></a>00292 {
-<a name="l00293"></a>00293    <span class="comment">// There is no need for the delays, since the digitalWrite operation</span>
-<a name="l00294"></a>00294    <span class="comment">// takes longer.</span>
-<a name="l00295"></a>00295    digitalWrite(_enable_pin, HIGH);
-<a name="l00296"></a>00296    <a class="code" href="_liquid_crystal_8cpp.html#a6eac41e4be58d7736ac0c19de225c0dc">waitUsec</a>(1);          <span class="comment">// enable pulse must be &gt; 450ns</span>
-<a name="l00297"></a>00297    
+<a name="l00183"></a>00183    <a class="code" href="class_l_c_d.html#a88b16ea0e5c7d1cabc5007d48bcbd2b0">_cols</a> = cols;
+<a name="l00184"></a>00184    
+<a name="l00185"></a>00185    <span class="comment">// for some 1 line displays you can select a 10 pixel high font</span>
+<a name="l00186"></a>00186    <span class="comment">// ------------------------------------------------------------</span>
+<a name="l00187"></a>00187    <span class="keywordflow">if</span> ((dotsize != 0) &amp;&amp; (lines == 1)) 
+<a name="l00188"></a>00188    {
+<a name="l00189"></a>00189       <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a> |= <a class="code" href="_l_c_d_8h.html#abb3210156d88d3fe18c9352eb161fe42">LCD_5x10DOTS</a>;
+<a name="l00190"></a>00190    }
+<a name="l00191"></a>00191    
+<a name="l00192"></a>00192    <span class="comment">// SEE PAGE 45/46 FOR INITIALIZATION SPECIFICATION!</span>
+<a name="l00193"></a>00193    <span class="comment">// according to datasheet, we need at least 40ms after power rises above 2.7V</span>
+<a name="l00194"></a>00194    <span class="comment">// before sending commands. Arduino can turn on way before 4.5V so we&#39;ll wait </span>
+<a name="l00195"></a>00195    <span class="comment">// 50</span>
+<a name="l00196"></a>00196    <span class="comment">// ---------------------------------------------------------------------------</span>
+<a name="l00197"></a>00197    delayMicroseconds(50000); 
+<a name="l00198"></a>00198    
+<a name="l00199"></a>00199    <span class="comment">// Now we pull both RS and R/W low to begin commands</span>
+<a name="l00200"></a>00200    digitalWrite(_rs_pin, LOW);
+<a name="l00201"></a>00201    digitalWrite(_enable_pin, LOW);
+<a name="l00202"></a>00202    
+<a name="l00203"></a>00203    <span class="keywordflow">if</span> (_rw_pin != 255) 
+<a name="l00204"></a>00204    { 
+<a name="l00205"></a>00205       digitalWrite(_rw_pin, LOW);
+<a name="l00206"></a>00206    }
+<a name="l00207"></a>00207    
+<a name="l00208"></a>00208    <span class="comment">//put the LCD into 4 bit or 8 bit mode</span>
+<a name="l00209"></a>00209    <span class="comment">// -------------------------------------</span>
+<a name="l00210"></a>00210    <span class="keywordflow">if</span> (! (<a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a> &amp; <a class="code" href="_l_c_d_8h.html#a59a57ca857dae5d89eb5f2a38c4ac6f0">LCD_8BITMODE</a>)) 
+<a name="l00211"></a>00211    {
+<a name="l00212"></a>00212       <span class="comment">// this is according to the hitachi HD44780 datasheet</span>
+<a name="l00213"></a>00213       <span class="comment">// figure 24, pg 46</span>
+<a name="l00214"></a>00214       
+<a name="l00215"></a>00215       <span class="comment">// we start in 8bit mode, try to set 4 bit mode</span>
+<a name="l00216"></a>00216       write4bits(0x03);
+<a name="l00217"></a>00217       delayMicroseconds(4500); <span class="comment">// wait min 4.1ms</span>
+<a name="l00218"></a>00218       
+<a name="l00219"></a>00219       <span class="comment">// second try</span>
+<a name="l00220"></a>00220       write4bits(0x03);
+<a name="l00221"></a>00221       delayMicroseconds(4500); <span class="comment">// wait min 4.1ms</span>
+<a name="l00222"></a>00222       
+<a name="l00223"></a>00223       <span class="comment">// third go!</span>
+<a name="l00224"></a>00224       write4bits(0x03); 
+<a name="l00225"></a>00225       delayMicroseconds(150);
+<a name="l00226"></a>00226       
+<a name="l00227"></a>00227       <span class="comment">// finally, set to 4-bit interface</span>
+<a name="l00228"></a>00228       write4bits(0x02); 
+<a name="l00229"></a>00229    } 
+<a name="l00230"></a>00230    <span class="keywordflow">else</span> 
+<a name="l00231"></a>00231    {
+<a name="l00232"></a>00232       <span class="comment">// this is according to the hitachi HD44780 datasheet</span>
+<a name="l00233"></a>00233       <span class="comment">// page 45 figure 23</span>
+<a name="l00234"></a>00234       
+<a name="l00235"></a>00235       <span class="comment">// Send function set command sequence</span>
+<a name="l00236"></a>00236       <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#aaef882ae70d1f485cd132815d9716111">LCD_FUNCTIONSET</a> | <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a>);
+<a name="l00237"></a>00237       delayMicroseconds(4500);  <span class="comment">// wait more than 4.1ms</span>
+<a name="l00238"></a>00238       
+<a name="l00239"></a>00239       <span class="comment">// second try</span>
+<a name="l00240"></a>00240       <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#aaef882ae70d1f485cd132815d9716111">LCD_FUNCTIONSET</a> | <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a>);
+<a name="l00241"></a>00241       delayMicroseconds(150);
+<a name="l00242"></a>00242       
+<a name="l00243"></a>00243       <span class="comment">// third go</span>
+<a name="l00244"></a>00244       <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#aaef882ae70d1f485cd132815d9716111">LCD_FUNCTIONSET</a> | <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a>);
+<a name="l00245"></a>00245    }
+<a name="l00246"></a>00246    
+<a name="l00247"></a>00247    <span class="comment">// finally, set # lines, font size, etc.</span>
+<a name="l00248"></a>00248    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#aaef882ae70d1f485cd132815d9716111">LCD_FUNCTIONSET</a> | <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a>);  
+<a name="l00249"></a>00249    
+<a name="l00250"></a>00250    <span class="comment">// turn the display on with no cursor or blinking default</span>
+<a name="l00251"></a>00251    <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a> = <a class="code" href="_l_c_d_8h.html#a76236ae8317b34bbc98ea56bc0a2639c">LCD_DISPLAYON</a> | <a class="code" href="_l_c_d_8h.html#a32b194a3adaa0a0bb69acee2e6a754fa">LCD_CURSOROFF</a> | <a class="code" href="_l_c_d_8h.html#a4b28243034cec656b0ed490ba6979752">LCD_BLINKOFF</a>;  
+<a name="l00252"></a>00252    <a class="code" href="class_l_c_d.html#a5b07cf05e8e5e7c53654f5ca0cf58b89">display</a>();
+<a name="l00253"></a>00253    
+<a name="l00254"></a>00254    <span class="comment">// clear the LCD</span>
+<a name="l00255"></a>00255    <a class="code" href="class_l_c_d.html#afa699e0beeeee03cce8cef87eba81c4a">clear</a>();
+<a name="l00256"></a>00256    
+<a name="l00257"></a>00257    <span class="comment">// Initialize to default text direction (for romance languages)</span>
+<a name="l00258"></a>00258    <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a> = <a class="code" href="_l_c_d_8h.html#ae7c6309fce6200bd7526d090a4a84dd0">LCD_ENTRYLEFT</a> | <a class="code" href="_l_c_d_8h.html#a049ee97e98d04788c1da9a55590fbe42">LCD_ENTRYSHIFTDECREMENT</a>;
+<a name="l00259"></a>00259    <span class="comment">// set the entry mode</span>
+<a name="l00260"></a>00260    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#a5597e1d5819ea2f0734ad4313abf6703">LCD_ENTRYMODESET</a> | <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a>);
+<a name="l00261"></a>00261    
+<a name="l00262"></a>00262 }
+<a name="l00263"></a>00263 
+<a name="l00264"></a>00264 <span class="comment">/************ low level data pushing commands **********/</span>
+<a name="l00265"></a>00265 
+<a name="l00266"></a>00266 <span class="comment">// send</span>
+<a name="l00267"></a><a class="code" href="class_liquid_crystal.html#a56142f8b3753bedd133e4139e5eb5089">00267</a> <span class="keywordtype">void</span> <a class="code" href="class_liquid_crystal.html#a56142f8b3753bedd133e4139e5eb5089">LiquidCrystal::send</a>(uint8_t value, uint8_t mode) 
+<a name="l00268"></a>00268 {
+<a name="l00269"></a>00269    digitalWrite( _rs_pin, mode );
+<a name="l00270"></a>00270    
+<a name="l00271"></a>00271    <span class="comment">// if there is a RW pin indicated, set it low to Write</span>
+<a name="l00272"></a>00272    <span class="comment">// ---------------------------------------------------</span>
+<a name="l00273"></a>00273    <span class="keywordflow">if</span> (_rw_pin != 255) 
+<a name="l00274"></a>00274    { 
+<a name="l00275"></a>00275       digitalWrite(_rw_pin, LOW);
+<a name="l00276"></a>00276    }
+<a name="l00277"></a>00277    
+<a name="l00278"></a>00278    <span class="keywordflow">if</span> (<a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a> &amp; <a class="code" href="_l_c_d_8h.html#a59a57ca857dae5d89eb5f2a38c4ac6f0">LCD_8BITMODE</a>)
+<a name="l00279"></a>00279    {
+<a name="l00280"></a>00280       write8bits(value); 
+<a name="l00281"></a>00281    } 
+<a name="l00282"></a>00282    <span class="keywordflow">else</span> 
+<a name="l00283"></a>00283    {
+<a name="l00284"></a>00284       write4bits ( value &gt;&gt; 4 );
+<a name="l00285"></a>00285       write4bits ( value );
+<a name="l00286"></a>00286    }
+<a name="l00287"></a>00287    <a class="code" href="_liquid_crystal_8cpp.html#a6eac41e4be58d7736ac0c19de225c0dc">waitUsec</a> ( <a class="code" href="_liquid_crystal_8h.html#adebff0f00a59c9f9863bc196938d5726">EXEC_TIME</a> ); <span class="comment">// wait for the command to execute by the LCD</span>
+<a name="l00288"></a>00288 }
+<a name="l00289"></a>00289 
+<a name="l00290"></a>00290 <span class="comment">//</span>
+<a name="l00291"></a>00291 <span class="comment">// pulseEnable</span>
+<a name="l00292"></a>00292 <span class="keywordtype">void</span> LiquidCrystal::pulseEnable(<span class="keywordtype">void</span>) 
+<a name="l00293"></a>00293 {
+<a name="l00294"></a>00294    <span class="comment">// There is no need for the delays, since the digitalWrite operation</span>
+<a name="l00295"></a>00295    <span class="comment">// takes longer.</span>
+<a name="l00296"></a>00296    digitalWrite(_enable_pin, HIGH);   
+<a name="l00297"></a>00297    <a class="code" href="_liquid_crystal_8cpp.html#a6eac41e4be58d7736ac0c19de225c0dc">waitUsec</a>(1);          <span class="comment">// enable pulse must be &gt; 450ns   </span>
 <a name="l00298"></a>00298    digitalWrite(_enable_pin, LOW);
 <a name="l00299"></a>00299 }
 <a name="l00300"></a>00300 
 </iframe>
 </div>
 
-<hr class="footer"/><address class="footer"><small>Generated on Sat Nov 19 2011 20:59:21 for LCD Library by&#160;
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jan 6 2012 14:21:03 for LCD Library 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>

File docs/html/_liquid_crystal_8h.html

 </iframe>
 </div>
 
-<hr class="footer"/><address class="footer"><small>Generated on Sat Nov 19 2011 20:59:21 for LCD Library by&#160;
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jan 6 2012 14:21:03 for LCD Library 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>

File docs/html/_liquid_crystal_8h_source.html

 </iframe>
 </div>
 
-<hr class="footer"/><address class="footer"><small>Generated on Sat Nov 19 2011 20:59:21 for LCD Library by&#160;
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jan 6 2012 14:21:03 for LCD Library 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>

File docs/html/_liquid_crystal___i2_c_8cpp.html

 </iframe>
 </div>
 
-<hr class="footer"/><address class="footer"><small>Generated on Sat Nov 19 2011 20:59:21 for LCD Library by&#160;
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jan 6 2012 14:21:03 for LCD Library 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>

File docs/html/_liquid_crystal___i2_c_8cpp_source.html

 <a name="l00070"></a>00070    _En = <a class="code" href="_liquid_crystal___i2_c_8h.html#a22e6626f2c98ed902f8ded47f6438c05">EN</a>;
 <a name="l00071"></a>00071    _Rw = <a class="code" href="_liquid_crystal___i2_c_8h.html#afc4ded33ac0ca43defcce639e965748a">RW</a>;
 <a name="l00072"></a>00072    _Rs = <a class="code" href="_liquid_crystal___i2_c_8h.html#af8903d8eea3868940c60af887473b152">RS</a>;
-<a name="l00073"></a>00073 
+<a name="l00073"></a>00073    
 <a name="l00074"></a>00074    <span class="comment">// Initialise default values data[0] pin 0, data[1] pin 1, ...</span>
 <a name="l00075"></a>00075    <span class="keywordflow">for</span> ( uint8_t i = 0; i &lt; 4; i++ )
 <a name="l00076"></a>00076    {
 <a name="l00079"></a>00079 }
 <a name="l00080"></a>00080 
 <a name="l00081"></a><a class="code" href="class_liquid_crystal___i2_c.html#a517f8847ebf09f0eacfb9c7232975fce">00081</a> <a class="code" href="class_liquid_crystal___i2_c.html#aac537d195557e0b8afac1a71441a484c">LiquidCrystal_I2C::LiquidCrystal_I2C</a>( uint8_t lcd_Addr, uint8_t En, uint8_t Rw,
-<a name="l00082"></a>00082                                       uint8_t Rs)
+<a name="l00082"></a>00082                                      uint8_t Rs)
 <a name="l00083"></a>00083 {
 <a name="l00084"></a>00084    _Addr = lcd_Addr;
 <a name="l00085"></a>00085    
 <a name="l00096"></a>00096 }
 <a name="l00097"></a>00097 
 <a name="l00098"></a><a class="code" href="class_liquid_crystal___i2_c.html#ac235f66c3d56320fca89545d0176caf5">00098</a> <a class="code" href="class_liquid_crystal___i2_c.html#aac537d195557e0b8afac1a71441a484c">LiquidCrystal_I2C::LiquidCrystal_I2C</a>( uint8_t lcd_Addr, uint8_t En, uint8_t Rw,
-<a name="l00099"></a>00099                                       uint8_t Rs, uint8_t d0, uint8_t d1,
-<a name="l00100"></a>00100                                       uint8_t d2, uint8_t d3 )
+<a name="l00099"></a>00099                                      uint8_t Rs, uint8_t d0, uint8_t d1,
+<a name="l00100"></a>00100                                      uint8_t d2, uint8_t d3 )
 <a name="l00101"></a>00101 {
 <a name="l00102"></a>00102    _Addr = lcd_Addr;
 <a name="l00103"></a>00103    
 <a name="l00125"></a>00125    <span class="comment">// initialize the backpack IO expander</span>
 <a name="l00126"></a>00126    <span class="comment">// and display functions.</span>
 <a name="l00127"></a>00127    <span class="comment">// ------------------------------------------------------------------------</span>
-<a name="l00128"></a>00128         <span class="keywordflow">if</span> ( _i2cio.<a class="code" href="class_i2_c_i_o.html#a6f814653d903dc2ff6e8420eeb7954ae">begin</a> ( _Addr ) == 1 )
+<a name="l00128"></a>00128    <span class="keywordflow">if</span> ( _i2cio.<a class="code" href="class_i2_c_i_o.html#a6f814653d903dc2ff6e8420eeb7954ae">begin</a> ( _Addr ) == 1 )
 <a name="l00129"></a>00129    {
 <a name="l00130"></a>00130       _i2cio.<a class="code" href="class_i2_c_i_o.html#a0341888753bc54c4384f5593a870fb34">portMode</a> ( OUTPUT );  <span class="comment">// Set the entire IO extender to OUTPUT</span>
 <a name="l00131"></a>00131       <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a> = <a class="code" href="_l_c_d_8h.html#ab8c35d355d2372090c7a347e961c9224">LCD_4BITMODE</a> | <a class="code" href="_l_c_d_8h.html#a8c85cf88d8af66a47c42249d81c94641">LCD_1LINE</a> | <a class="code" href="_l_c_d_8h.html#a9ef57e724c1b846dae0f531aff6fb464">LCD_5x8DOTS</a>;
 <a name="l00142"></a>00142 <span class="comment">// begin</span>
 <a name="l00143"></a><a class="code" href="class_liquid_crystal___i2_c.html#aeee2ada537f0cfbfda8613324b57c4a6">00143</a> <span class="keywordtype">void</span> <a class="code" href="class_liquid_crystal___i2_c.html#aeee2ada537f0cfbfda8613324b57c4a6">LiquidCrystal_I2C::begin</a>(uint8_t cols, uint8_t lines, uint8_t dotsize) 
 <a name="l00144"></a>00144 {
-<a name="l00145"></a>00145    _cols = cols;
-<a name="l00146"></a>00146    _rows = lines;
+<a name="l00145"></a>00145    
+<a name="l00146"></a>00146    init();     <span class="comment">// Initialise the I2C expander interface</span>
 <a name="l00147"></a>00147    
-<a name="l00148"></a>00148    init();     <span class="comment">// Initialise the I2C expander interface</span>
-<a name="l00149"></a>00149    
-<a name="l00150"></a>00150         <span class="keywordflow">if</span> (lines &gt; 1) 
-<a name="l00151"></a>00151    {
-<a name="l00152"></a>00152                 <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a> |= <a class="code" href="_l_c_d_8h.html#a7987e93538df2819583ba43b81ddbb25">LCD_2LINE</a>;
-<a name="l00153"></a>00153         }
-<a name="l00154"></a>00154         <a class="code" href="class_l_c_d.html#ac1374911fb145fea430c21092ada0c06">_numlines</a> = lines;
-<a name="l00155"></a>00155    
-<a name="l00156"></a>00156         <span class="comment">// for some 1 line displays you can select a 10 pixel high font</span>
-<a name="l00157"></a>00157         <span class="keywordflow">if</span> ((dotsize != 0) &amp;&amp; (lines == 1)) {
-<a name="l00158"></a>00158                 <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a> |= <a class="code" href="_l_c_d_8h.html#abb3210156d88d3fe18c9352eb161fe42">LCD_5x10DOTS</a>;
-<a name="l00159"></a>00159         }
-<a name="l00160"></a>00160    
-<a name="l00161"></a>00161         <span class="comment">// SEE PAGE 45/46 FOR INITIALIZATION SPECIFICATION!</span>
-<a name="l00162"></a>00162         <span class="comment">// according to datasheet, we need at least 40ms after power rises above 2.7V</span>
-<a name="l00163"></a>00163         <span class="comment">// before sending commands. Arduino can turn on way before 4.5V so we&#39;ll wait 50</span>
-<a name="l00164"></a>00164         delayMicroseconds(50000); 
-<a name="l00165"></a>00165    
-<a name="l00166"></a>00166         <span class="comment">// Now we pull both RS and R/W low to begin commands</span>
-<a name="l00167"></a>00167         expanderWrite ( _backlightval );        <span class="comment">// reset expander and turn backlight off (Bit 8 =1)</span>
-<a name="l00168"></a>00168         delay(1000);
-<a name="l00169"></a>00169    
-<a name="l00170"></a>00170         <span class="comment">//put the LCD into 4 bit mode</span>
-<a name="l00171"></a>00171         <span class="comment">// this is according to the hitachi HD44780 datasheet</span>
-<a name="l00172"></a>00172         <span class="comment">// figure 24, pg 46</span>
-<a name="l00173"></a>00173         
-<a name="l00174"></a>00174         <span class="comment">// we start in 8bit mode, try to set 4 bit mode</span>
-<a name="l00175"></a>00175         write4bits ( 0x03, LOW );
-<a name="l00176"></a>00176         delayMicroseconds(4500); <span class="comment">// wait min 4.1ms</span>
-<a name="l00177"></a>00177         
-<a name="l00178"></a>00178         <span class="comment">// second try</span>
-<a name="l00179"></a>00179         write4bits ( 0x03, LOW );
-<a name="l00180"></a>00180         delayMicroseconds(4500); <span class="comment">// wait min 4.1ms</span>
-<a name="l00181"></a>00181         
-<a name="l00182"></a>00182         <span class="comment">// third go!</span>
-<a name="l00183"></a>00183         write4bits ( 0x03, LOW ); 
-<a name="l00184"></a>00184         delayMicroseconds(150);
-<a name="l00185"></a>00185         
-<a name="l00186"></a>00186         <span class="comment">// finally, set to 4-bit interface</span>
-<a name="l00187"></a>00187         write4bits ( 0x02, LOW ); 
+<a name="l00148"></a>00148    <span class="keywordflow">if</span> (lines &gt; 1) 
+<a name="l00149"></a>00149    {
+<a name="l00150"></a>00150       <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a> |= <a class="code" href="_l_c_d_8h.html#a7987e93538df2819583ba43b81ddbb25">LCD_2LINE</a>;
+<a name="l00151"></a>00151    }
+<a name="l00152"></a>00152    <a class="code" href="class_l_c_d.html#ac1374911fb145fea430c21092ada0c06">_numlines</a> = lines;
+<a name="l00153"></a>00153    <a class="code" href="class_l_c_d.html#a88b16ea0e5c7d1cabc5007d48bcbd2b0">_cols</a> = cols;
+<a name="l00154"></a>00154    
+<a name="l00155"></a>00155    <span class="comment">// for some 1 line displays you can select a 10 pixel high font</span>
+<a name="l00156"></a>00156    <span class="keywordflow">if</span> ((dotsize != 0) &amp;&amp; (lines == 1)) {
+<a name="l00157"></a>00157       <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a> |= <a class="code" href="_l_c_d_8h.html#abb3210156d88d3fe18c9352eb161fe42">LCD_5x10DOTS</a>;
+<a name="l00158"></a>00158    }
+<a name="l00159"></a>00159    
+<a name="l00160"></a>00160    <span class="comment">// SEE PAGE 45/46 FOR INITIALIZATION SPECIFICATION!</span>
+<a name="l00161"></a>00161    <span class="comment">// according to datasheet, we need at least 40ms after power rises above 2.7V</span>
+<a name="l00162"></a>00162    <span class="comment">// before sending commands. Arduino can turn on way before 4.5V so we&#39;ll wait 50</span>
+<a name="l00163"></a>00163    delayMicroseconds(50000); 
+<a name="l00164"></a>00164    
+<a name="l00165"></a>00165    <span class="comment">// Now we pull both RS and R/W low to begin commands</span>
+<a name="l00166"></a>00166    expanderWrite ( _backlightval );   <span class="comment">// reset expander and turn backlight off (Bit 8 =1)</span>
+<a name="l00167"></a>00167    delay(1000);
+<a name="l00168"></a>00168    
+<a name="l00169"></a>00169    <span class="comment">//put the LCD into 4 bit mode</span>
+<a name="l00170"></a>00170    <span class="comment">// this is according to the hitachi HD44780 datasheet</span>
+<a name="l00171"></a>00171    <span class="comment">// figure 24, pg 46</span>
+<a name="l00172"></a>00172    
+<a name="l00173"></a>00173    <span class="comment">// we start in 8bit mode, try to set 4 bit mode</span>
+<a name="l00174"></a>00174    write4bits ( 0x03, LOW );
+<a name="l00175"></a>00175    delayMicroseconds(4500); <span class="comment">// wait min 4.1ms</span>
+<a name="l00176"></a>00176    
+<a name="l00177"></a>00177    <span class="comment">// second try</span>
+<a name="l00178"></a>00178    write4bits ( 0x03, LOW );
+<a name="l00179"></a>00179    delayMicroseconds(4500); <span class="comment">// wait min 4.1ms</span>
+<a name="l00180"></a>00180    
+<a name="l00181"></a>00181    <span class="comment">// third go!</span>
+<a name="l00182"></a>00182    write4bits ( 0x03, LOW ); 
+<a name="l00183"></a>00183    delayMicroseconds(150);
+<a name="l00184"></a>00184    
+<a name="l00185"></a>00185    <span class="comment">// finally, set to 4-bit interface</span>
+<a name="l00186"></a>00186    write4bits ( 0x02, LOW ); 
+<a name="l00187"></a>00187    
 <a name="l00188"></a>00188    
-<a name="l00189"></a>00189    
-<a name="l00190"></a>00190         <span class="comment">// set # lines, font size, etc.</span>
-<a name="l00191"></a>00191         <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#aaef882ae70d1f485cd132815d9716111">LCD_FUNCTIONSET</a> | <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a>);  
-<a name="l00192"></a>00192         
-<a name="l00193"></a>00193         <span class="comment">// turn the display on with no cursor or blinking default</span>
-<a name="l00194"></a>00194         <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a> = <a class="code" href="_l_c_d_8h.html#a76236ae8317b34bbc98ea56bc0a2639c">LCD_DISPLAYON</a> | <a class="code" href="_l_c_d_8h.html#a32b194a3adaa0a0bb69acee2e6a754fa">LCD_CURSOROFF</a> | <a class="code" href="_l_c_d_8h.html#a4b28243034cec656b0ed490ba6979752">LCD_BLINKOFF</a>;
-<a name="l00195"></a>00195         <a class="code" href="class_l_c_d.html#a5b07cf05e8e5e7c53654f5ca0cf58b89">display</a>();
-<a name="l00196"></a>00196         
-<a name="l00197"></a>00197         <span class="comment">// clear it off</span>
-<a name="l00198"></a>00198         <a class="code" href="class_l_c_d.html#afa699e0beeeee03cce8cef87eba81c4a">clear</a>();
-<a name="l00199"></a>00199         
-<a name="l00200"></a>00200         <span class="comment">// Initialize to default text direction (for roman languages)</span>
-<a name="l00201"></a>00201         <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a> = <a class="code" href="_l_c_d_8h.html#ae7c6309fce6200bd7526d090a4a84dd0">LCD_ENTRYLEFT</a> | <a class="code" href="_l_c_d_8h.html#a049ee97e98d04788c1da9a55590fbe42">LCD_ENTRYSHIFTDECREMENT</a>;
-<a name="l00202"></a>00202         
-<a name="l00203"></a>00203         <span class="comment">// set the entry mode</span>
-<a name="l00204"></a>00204         <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#a5597e1d5819ea2f0734ad4313abf6703">LCD_ENTRYMODESET</a> | <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a>);
-<a name="l00205"></a>00205         
-<a name="l00206"></a>00206         <a class="code" href="class_l_c_d.html#aee45ad37f09312f5d9982257e2d37e68">home</a>();
-<a name="l00207"></a>00207    
-<a name="l00208"></a>00208 }
+<a name="l00189"></a>00189    <span class="comment">// set # lines, font size, etc.</span>
+<a name="l00190"></a>00190    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#aaef882ae70d1f485cd132815d9716111">LCD_FUNCTIONSET</a> | <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a>);  
+<a name="l00191"></a>00191    
+<a name="l00192"></a>00192    <span class="comment">// turn the display on with no cursor or blinking default</span>
+<a name="l00193"></a>00193    <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a> = <a class="code" href="_l_c_d_8h.html#a76236ae8317b34bbc98ea56bc0a2639c">LCD_DISPLAYON</a> | <a class="code" href="_l_c_d_8h.html#a32b194a3adaa0a0bb69acee2e6a754fa">LCD_CURSOROFF</a> | <a class="code" href="_l_c_d_8h.html#a4b28243034cec656b0ed490ba6979752">LCD_BLINKOFF</a>;
+<a name="l00194"></a>00194    <a class="code" href="class_l_c_d.html#a5b07cf05e8e5e7c53654f5ca0cf58b89">display</a>();
+<a name="l00195"></a>00195    
+<a name="l00196"></a>00196    <span class="comment">// clear it off</span>
+<a name="l00197"></a>00197    <a class="code" href="class_l_c_d.html#afa699e0beeeee03cce8cef87eba81c4a">clear</a>();
+<a name="l00198"></a>00198    
+<a name="l00199"></a>00199    <span class="comment">// Initialize to default text direction (for roman languages)</span>
+<a name="l00200"></a>00200    <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a> = <a class="code" href="_l_c_d_8h.html#ae7c6309fce6200bd7526d090a4a84dd0">LCD_ENTRYLEFT</a> | <a class="code" href="_l_c_d_8h.html#a049ee97e98d04788c1da9a55590fbe42">LCD_ENTRYSHIFTDECREMENT</a>;
+<a name="l00201"></a>00201    
+<a name="l00202"></a>00202    <span class="comment">// set the entry mode</span>
+<a name="l00203"></a>00203    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#a5597e1d5819ea2f0734ad4313abf6703">LCD_ENTRYMODESET</a> | <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a>);
+<a name="l00204"></a>00204    
+<a name="l00205"></a>00205    <a class="code" href="class_l_c_d.html#aee45ad37f09312f5d9982257e2d37e68">home</a>();
+<a name="l00206"></a>00206    
+<a name="l00207"></a>00207 }
+<a name="l00208"></a>00208 
 <a name="l00209"></a>00209 
-<a name="l00210"></a>00210 
-<a name="l00211"></a>00211 <span class="comment">// User commands - users can expand this section</span>
-<a name="l00212"></a>00212 <span class="comment">//----------------------------------------------------------------------------</span>
-<a name="l00213"></a>00213 
-<a name="l00214"></a>00214 <span class="comment">// Turn the (optional) backlight off/on</span>
-<a name="l00215"></a><a class="code" href="class_liquid_crystal___i2_c.html#a576f1f5813f55f34333d6d7e9fe53ad3">00215</a> <span class="keywordtype">void</span> <a class="code" href="class_liquid_crystal___i2_c.html#a576f1f5813f55f34333d6d7e9fe53ad3">LiquidCrystal_I2C::noBacklight</a>(<span class="keywordtype">void</span>) 
-<a name="l00216"></a>00216 {
-<a name="l00217"></a>00217         _backlightval=<a class="code" href="_liquid_crystal___i2_c_8h.html#a65fa786d6e31fe8b1aa51784a9736581">LCD_NOBACKLIGHT</a>;
-<a name="l00218"></a>00218         expanderWrite(0);
-<a name="l00219"></a>00219 }
-<a name="l00220"></a>00220 
-<a name="l00221"></a><a class="code" href="class_liquid_crystal___i2_c.html#a9f296e0d26f8b6a4509d8d4b9d738c03">00221</a> <span class="keywordtype">void</span> <a class="code" href="class_liquid_crystal___i2_c.html#a9f296e0d26f8b6a4509d8d4b9d738c03">LiquidCrystal_I2C::backlight</a>(<span class="keywordtype">void</span>) 
-<a name="l00222"></a>00222 {
-<a name="l00223"></a>00223         _backlightval=<a class="code" href="_liquid_crystal___i2_c_8h.html#ac059d24dfe9c1e1f7c07cb7869a1833b">LCD_BACKLIGHT</a>;
-<a name="l00224"></a>00224         expanderWrite(0);
-<a name="l00225"></a>00225 }
-<a name="l00226"></a>00226 
-<a name="l00227"></a>00227 <span class="comment">// PRIVATE METHODS</span>
-<a name="l00228"></a>00228 <span class="comment">// ---------------------------------------------------------------------------</span>
-<a name="l00229"></a>00229 
-<a name="l00230"></a>00230 <span class="comment">// low level data pushing commands</span>
-<a name="l00231"></a>00231 <span class="comment">//----------------------------------------------------------------------------</span>
-<a name="l00232"></a>00232 
-<a name="l00233"></a>00233 <span class="comment">//</span>
-<a name="l00234"></a>00234 <span class="comment">// send - write either command or data</span>
-<a name="l00235"></a><a class="code" href="class_liquid_crystal___i2_c.html#a8bf1fab7efe13e8b17b96c42d1f810b4">00235</a> <span class="keywordtype">void</span> <a class="code" href="class_liquid_crystal___i2_c.html#a8bf1fab7efe13e8b17b96c42d1f810b4">LiquidCrystal_I2C::send</a>(uint8_t value, uint8_t mode) 
-<a name="l00236"></a>00236 {
-<a name="l00237"></a>00237    
-<a name="l00238"></a>00238    write4bits( (value &gt;&gt; 4), mode );
-<a name="l00239"></a>00239         write4bits( (value &amp; 0x0F), mode);
-<a name="l00240"></a>00240 }
-<a name="l00241"></a>00241 
-<a name="l00242"></a>00242 <span class="comment">//</span>
-<a name="l00243"></a>00243 <span class="comment">// write4bits</span>
-<a name="l00244"></a>00244 <span class="keywordtype">void</span> LiquidCrystal_I2C::write4bits ( uint8_t value, uint8_t mode ) 
-<a name="l00245"></a>00245 {
-<a name="l00246"></a>00246    uint8_t pinMapValue = 0;
-<a name="l00247"></a>00247    
-<a name="l00248"></a>00248    <span class="comment">// Map the value to LCD pin mapping</span>
-<a name="l00249"></a>00249    <span class="comment">// --------------------------------</span>
-<a name="l00250"></a>00250    <span class="keywordflow">for</span> ( uint8_t i = 0; i &lt; 4; i++ )
-<a name="l00251"></a>00251    {
-<a name="l00252"></a>00252       <span class="keywordflow">if</span> ( ( value &amp; 0x1 ) == 1 )
-<a name="l00253"></a>00253       {
-<a name="l00254"></a>00254          pinMapValue |= _data_pins[i];
-<a name="l00255"></a>00255       }
-<a name="l00256"></a>00256       value = ( value &gt;&gt; 1 );
-<a name="l00257"></a>00257    }
-<a name="l00258"></a>00258    
-<a name="l00259"></a>00259    <span class="comment">// Is it a command or data</span>
-<a name="l00260"></a>00260    <span class="comment">// -----------------------</span>
-<a name="l00261"></a>00261    <span class="keywordflow">if</span> ( mode == <a class="code" href="_l_c_d_8h.html#aad9ae913bdfab20dd94ad04ee2d5b045">DATA</a> )
-<a name="l00262"></a>00262    {
-<a name="l00263"></a>00263       mode = _Rs;
-<a name="l00264"></a>00264    }
-<a name="l00265"></a>00265    
-<a name="l00266"></a>00266         expanderWrite ( pinMapValue | mode );
-<a name="l00267"></a>00267         pulseEnable ( pinMapValue | mode );
-<a name="l00268"></a>00268 }
-<a name="l00269"></a>00269 
-<a name="l00270"></a>00270 <span class="comment">//</span>
-<a name="l00271"></a>00271 <span class="comment">// write4bits</span>
-<a name="l00272"></a>00272 <span class="keywordtype">void</span> LiquidCrystal_I2C::pulseEnable (uint8_t _data)
-<a name="l00273"></a>00273 {
-<a name="l00274"></a>00274    <span class="comment">// No need to use the delay routines since the time taken to write takes</span>
-<a name="l00275"></a>00275    <span class="comment">// longer that what is needed.</span>
-<a name="l00276"></a>00276         expanderWrite (_data | _En);    <span class="comment">// En HIGH</span>
-<a name="l00277"></a>00277    
-<a name="l00278"></a>00278         expanderWrite(_data &amp; ~_En);  <span class="comment">// En LOW</span>
-<a name="l00279"></a>00279 } 
-<a name="l00280"></a>00280 
-<a name="l00281"></a>00281 <span class="comment">//</span>
-<a name="l00282"></a>00282 <span class="comment">// expanderWrite</span>
-<a name="l00283"></a>00283 <span class="keywordtype">void</span> LiquidCrystal_I2C::expanderWrite(uint8_t _data)
-<a name="l00284"></a>00284 {                                        
-<a name="l00285"></a>00285    _i2cio.<a class="code" href="class_i2_c_i_o.html#ae2063569c927d0008e2593d14504fdcd">write</a> ( _data );
-<a name="l00286"></a>00286 }
+<a name="l00210"></a>00210 <span class="comment">// User commands - users can expand this section</span>
+<a name="l00211"></a>00211 <span class="comment">//----------------------------------------------------------------------------</span>
+<a name="l00212"></a>00212 
+<a name="l00213"></a>00213 <span class="comment">// Turn the (optional) backlight off/on</span>
+<a name="l00214"></a><a class="code" href="class_liquid_crystal___i2_c.html#a576f1f5813f55f34333d6d7e9fe53ad3">00214</a> <span class="keywordtype">void</span> <a class="code" href="class_liquid_crystal___i2_c.html#a576f1f5813f55f34333d6d7e9fe53ad3">LiquidCrystal_I2C::noBacklight</a>(<span class="keywordtype">void</span>) 
+<a name="l00215"></a>00215 {
+<a name="l00216"></a>00216    _backlightval=<a class="code" href="_liquid_crystal___i2_c_8h.html#a65fa786d6e31fe8b1aa51784a9736581">LCD_NOBACKLIGHT</a>;
+<a name="l00217"></a>00217    expanderWrite(0);
+<a name="l00218"></a>00218 }
+<a name="l00219"></a>00219 
+<a name="l00220"></a><a class="code" href="class_liquid_crystal___i2_c.html#a9f296e0d26f8b6a4509d8d4b9d738c03">00220</a> <span class="keywordtype">void</span> <a class="code" href="class_liquid_crystal___i2_c.html#a9f296e0d26f8b6a4509d8d4b9d738c03">LiquidCrystal_I2C::backlight</a>(<span class="keywordtype">void</span>) 
+<a name="l00221"></a>00221 {
+<a name="l00222"></a>00222    _backlightval=<a class="code" href="_liquid_crystal___i2_c_8h.html#ac059d24dfe9c1e1f7c07cb7869a1833b">LCD_BACKLIGHT</a>;
+<a name="l00223"></a>00223    expanderWrite(0);
+<a name="l00224"></a>00224 }
+<a name="l00225"></a>00225 
+<a name="l00226"></a>00226 <span class="comment">// PRIVATE METHODS</span>
+<a name="l00227"></a>00227 <span class="comment">// ---------------------------------------------------------------------------</span>
+<a name="l00228"></a>00228 
+<a name="l00229"></a>00229 <span class="comment">// low level data pushing commands</span>
+<a name="l00230"></a>00230 <span class="comment">//----------------------------------------------------------------------------</span>
+<a name="l00231"></a>00231 
+<a name="l00232"></a>00232 <span class="comment">//</span>
+<a name="l00233"></a>00233 <span class="comment">// send - write either command or data</span>
+<a name="l00234"></a><a class="code" href="class_liquid_crystal___i2_c.html#a8bf1fab7efe13e8b17b96c42d1f810b4">00234</a> <span class="keywordtype">void</span> <a class="code" href="class_liquid_crystal___i2_c.html#a8bf1fab7efe13e8b17b96c42d1f810b4">LiquidCrystal_I2C::send</a>(uint8_t value, uint8_t mode) 
+<a name="l00235"></a>00235 {
+<a name="l00236"></a>00236    <span class="comment">// No need to use the delay routines since the time taken to write takes</span>
+<a name="l00237"></a>00237    <span class="comment">// longer that what is needed both for toggling and enable pin an to execute</span>
+<a name="l00238"></a>00238    <span class="comment">// the command.</span>
+<a name="l00239"></a>00239    write4bits( (value &gt;&gt; 4), mode );
+<a name="l00240"></a>00240    write4bits( (value &amp; 0x0F), mode);
+<a name="l00241"></a>00241 }
+<a name="l00242"></a>00242 
+<a name="l00243"></a>00243 <span class="comment">//</span>
+<a name="l00244"></a>00244 <span class="comment">// write4bits</span>
+<a name="l00245"></a>00245 <span class="keywordtype">void</span> LiquidCrystal_I2C::write4bits ( uint8_t value, uint8_t mode ) 
+<a name="l00246"></a>00246 {
+<a name="l00247"></a>00247    uint8_t pinMapValue = 0;
+<a name="l00248"></a>00248    
+<a name="l00249"></a>00249    <span class="comment">// Map the value to LCD pin mapping</span>
+<a name="l00250"></a>00250    <span class="comment">// --------------------------------</span>
+<a name="l00251"></a>00251    <span class="keywordflow">for</span> ( uint8_t i = 0; i &lt; 4; i++ )
+<a name="l00252"></a>00252    {
+<a name="l00253"></a>00253       <span class="keywordflow">if</span> ( ( value &amp; 0x1 ) == 1 )
+<a name="l00254"></a>00254       {
+<a name="l00255"></a>00255          pinMapValue |= _data_pins[i];
+<a name="l00256"></a>00256       }
+<a name="l00257"></a>00257       value = ( value &gt;&gt; 1 );
+<a name="l00258"></a>00258    }
+<a name="l00259"></a>00259    
+<a name="l00260"></a>00260    <span class="comment">// Is it a command or data</span>
+<a name="l00261"></a>00261    <span class="comment">// -----------------------</span>
+<a name="l00262"></a>00262    <span class="keywordflow">if</span> ( mode == <a class="code" href="_l_c_d_8h.html#aad9ae913bdfab20dd94ad04ee2d5b045">DATA</a> )
+<a name="l00263"></a>00263    {
+<a name="l00264"></a>00264       mode = _Rs;
+<a name="l00265"></a>00265    }
+<a name="l00266"></a>00266    
+<a name="l00267"></a>00267    expanderWrite ( pinMapValue | mode );
+<a name="l00268"></a>00268    pulseEnable ( pinMapValue | mode );
+<a name="l00269"></a>00269 }
+<a name="l00270"></a>00270 
+<a name="l00271"></a>00271 <span class="comment">//</span>
+<a name="l00272"></a>00272 <span class="comment">// write4bits</span>
+<a name="l00273"></a>00273 <span class="keywordtype">void</span> LiquidCrystal_I2C::pulseEnable (uint8_t _data)
+<a name="l00274"></a>00274 {
+<a name="l00275"></a>00275    expanderWrite (_data | _En);   <span class="comment">// En HIGH</span>
+<a name="l00276"></a>00276    expanderWrite(_data &amp; ~_En);   <span class="comment">// En LOW</span>
+<a name="l00277"></a>00277 } 
+<a name="l00278"></a>00278 
+<a name="l00279"></a>00279 <span class="comment">//</span>
+<a name="l00280"></a>00280 <span class="comment">// expanderWrite</span>
+<a name="l00281"></a>00281 <span class="keywordtype">void</span> LiquidCrystal_I2C::expanderWrite(uint8_t _data)
+<a name="l00282"></a>00282 {                                        
+<a name="l00283"></a>00283    _i2cio.<a class="code" href="class_i2_c_i_o.html#ae2063569c927d0008e2593d14504fdcd">write</a> ( _data );
+<a name="l00284"></a>00284 }
+<a name="l00285"></a>00285 
+<a name="l00286"></a>00286 
 <a name="l00287"></a>00287 
 <a name="l00288"></a>00288 
-<a name="l00289"></a>00289 
-<a name="l00290"></a>00290 
 </pre></div></div>
 </div>
 <!-- window showing the filter options -->
 </iframe>
 </div>
 
-<hr class="footer"/><address class="footer"><small>Generated on Sat Nov 19 2011 20:59:21 for LCD Library by&#160;
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jan 6 2012 14:21:03 for LCD Library 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>

File docs/html/_liquid_crystal___i2_c_8h.html

 </iframe>
 </div>
 
-<hr class="footer"/><address class="footer"><small>Generated on Sat Nov 19 2011 20:59:21 for LCD Library by&#160;
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jan 6 2012 14:21:03 for LCD Library 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>

File docs/html/_liquid_crystal___i2_c_8h_source.html

 <a name="l00201"></a>00201    <span class="keywordtype">void</span> expanderWrite(uint8_t);
 <a name="l00202"></a>00202    
 <a name="l00203"></a>00203    uint8_t _Addr;           <span class="comment">// I2C Address of the IO expander</span>
-<a name="l00204"></a>00204    uint8_t _cols;           <span class="comment">// Number of columns of the LCD</span>
-<a name="l00205"></a>00205    uint8_t _rows;           <span class="comment">// Number of rows of the LCD</span>
-<a name="l00206"></a>00206    uint8_t _backlightval;   <span class="comment">// Backlight shadow value</span>
-<a name="l00207"></a>00207    <a class="code" href="class_i2_c_i_o.html">I2CIO</a>   _i2cio;          <span class="comment">// I2CIO PCF8574* expansion module driver I2CLCDextraIO</span>
-<a name="l00208"></a>00208    uint8_t _En;             <span class="comment">// LCD expander word for enable pin</span>
-<a name="l00209"></a>00209    uint8_t _Rw;             <span class="comment">// LCD expander word for R/W pin</span>
-<a name="l00210"></a>00210    uint8_t _Rs;             <span class="comment">// LCD expander word for Register Select pin</span>
-<a name="l00211"></a>00211    uint8_t _data_pins[4];   <span class="comment">// LCD data lines</span>
-<a name="l00212"></a>00212    
-<a name="l00213"></a>00213 };
-<a name="l00214"></a>00214 
-<a name="l00215"></a>00215 <span class="preprocessor">#endif</span>
+<a name="l00204"></a>00204    uint8_t _backlightval;   <span class="comment">// Backlight shadow value</span>
+<a name="l00205"></a>00205    <a class="code" href="class_i2_c_i_o.html">I2CIO</a>   _i2cio;          <span class="comment">// I2CIO PCF8574* expansion module driver I2CLCDextraIO</span>
+<a name="l00206"></a>00206    uint8_t _En;             <span class="comment">// LCD expander word for enable pin</span>
+<a name="l00207"></a>00207    uint8_t _Rw;             <span class="comment">// LCD expander word for R/W pin</span>
+<a name="l00208"></a>00208    uint8_t _Rs;             <span class="comment">// LCD expander word for Register Select pin</span>
+<a name="l00209"></a>00209    uint8_t _data_pins[4];   <span class="comment">// LCD data lines</span>
+<a name="l00210"></a>00210    
+<a name="l00211"></a>00211 };
+<a name="l00212"></a>00212 
+<a name="l00213"></a>00213 <span class="preprocessor">#endif</span>
 </pre></div></div>
 </div>
 <!-- window showing the filter options -->
 </iframe>
 </div>
 
-<hr class="footer"/><address class="footer"><small>Generated on Sat Nov 19 2011 20:59:21 for LCD Library by&#160;
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jan 6 2012 14:21:03 for LCD Library 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>

File docs/html/_liquid_crystal___s_r_8cpp.html

   </div>
 </div>
 <div class="header">
+  <div class="summary">
+<a href="#func-members">Functions</a>  </div>
   <div class="headertitle">
 <div class="title">/Users/fmalpartida/development/ardWorkspace/LiquidCrystal_I2C/LiquiCrystal_I2C/LiquidCrystal_SR.cpp File Reference</div>  </div>
 </div>
 </div>
 <p><a href="_liquid_crystal___s_r_8cpp_source.html">Go to the source code of this file.</a></p>
 <table class="memberdecls">
+<tr><td colspan="2"><h2><a name="func-members"></a>
+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="_liquid_crystal___s_r_8cpp.html#a6eac41e4be58d7736ac0c19de225c0dc">waitUsec</a> (uint16_t uSec)</td></tr>
 </table>
+<hr/><h2>Function Documentation</h2>
+<a class="anchor" id="a6eac41e4be58d7736ac0c19de225c0dc"></a><!-- doxytag: member="LiquidCrystal_SR.cpp::waitUsec" ref="a6eac41e4be58d7736ac0c19de225c0dc" args="(uint16_t uSec)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">static void waitUsec </td>
+          <td>(</td>
+          <td class="paramtype">uint16_t&#160;</td>
+          <td class="paramname"><em>uSec</em></td><td>)</td>
+          <td><code> [inline, static]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>waits for a given time in microseconds (compilation dependent).  Waits for a given time defined in microseconds depending on the FAST_MODE define. If the FAST_MODE is defined the call will return inmediatelly. </p>
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table class="params">
+    <tr><td class="paramname">uSec[in]</td><td>time in microseconds. </td></tr>
+  </table>
+  </dd>
+</dl>
+<dl class="return"><dt><b>Returns:</b></dt><dd>None </dd></dl>
+
+<p>Definition at line <a class="el" href="_liquid_crystal___s_r_8cpp_source.html#l00117">117</a> of file <a class="el" href="_liquid_crystal___s_r_8cpp_source.html">LiquidCrystal_SR.cpp</a>.</p>
+
+</div>
+</div>
 </div>
 <!-- window showing the filter options -->
 <div id="MSearchSelectWindow"
 </iframe>
 </div>
 
-<hr class="footer"/><address class="footer"><small>Generated on Sat Nov 19 2011 20:59:21 for LCD Library by&#160;
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jan 6 2012 14:21:03 for LCD Library 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>

File docs/html/_liquid_crystal___s_r_8cpp_source.html

 <a name="l00103"></a>00103 <span class="comment">// LiquidCrystal constructor is called).</span>
 <a name="l00104"></a>00104 <span class="comment">// A call to begin() will reinitialize the LCD.</span>
 <a name="l00105"></a>00105 
-<a name="l00106"></a>00106 
-<a name="l00107"></a>00107 <span class="comment">// CONSTRUCTORS</span>
-<a name="l00108"></a>00108 <span class="comment">// ---------------------------------------------------------------------------</span>
-<a name="l00109"></a>00109 <span class="comment">// Assuming 1 line 8 pixel high font</span>
-<a name="l00110"></a><a class="code" href="class_liquid_crystal___s_r.html#a40bca9b97ad5c1e938c7dee1fd0850f2">00110</a> <a class="code" href="class_liquid_crystal___s_r.html#a40bca9b97ad5c1e938c7dee1fd0850f2">LiquidCrystal_SR::LiquidCrystal_SR</a> ( uint8_t srdata, uint8_t srclock, 
-<a name="l00111"></a>00111                                      uint8_t enable ) 
-<a name="l00112"></a>00112 {
-<a name="l00113"></a>00113         init ( srdata, srclock, enable, 1, 0 );
-<a name="l00114"></a>00114 }
-<a name="l00115"></a>00115 <span class="comment">// Set nr. of lines, assume 8 pixel high font</span>
-<a name="l00116"></a><a class="code" href="class_liquid_crystal___s_r.html#ad2377db39d91f6fa4abf3526113ba13e">00116</a> <a class="code" href="class_liquid_crystal___s_r.html#a40bca9b97ad5c1e938c7dee1fd0850f2">LiquidCrystal_SR::LiquidCrystal_SR</a> ( uint8_t srdata, uint8_t srclock, 
-<a name="l00117"></a>00117                                      uint8_t enable, uint8_t lines ) 
+<a name="l00106"></a>00106 <span class="comment">// STATIC helper routines</span>
+<a name="l00107"></a>00107 <span class="comment">// ---------------------------------------------------------------------------</span>
+<a name="l00117"></a><a class="code" href="_liquid_crystal___s_r_8cpp.html#a6eac41e4be58d7736ac0c19de225c0dc">00117</a> <span class="comment"></span><span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="_liquid_crystal___s_r_8cpp.html#a6eac41e4be58d7736ac0c19de225c0dc">waitUsec</a> ( uint16_t uSec )
 <a name="l00118"></a>00118 {
-<a name="l00119"></a>00119         init ( srdata, srclock, enable, lines, 0 );
-<a name="l00120"></a>00120 }
-<a name="l00121"></a>00121 
-<a name="l00122"></a>00122 <span class="comment">// Set nr. of lines and font</span>
-<a name="l00123"></a><a class="code" href="class_liquid_crystal___s_r.html#afdfbb7740939f28181c94b7876aa8add">00123</a> <a class="code" href="class_liquid_crystal___s_r.html#a40bca9b97ad5c1e938c7dee1fd0850f2">LiquidCrystal_SR::LiquidCrystal_SR</a> ( uint8_t srdata, uint8_t srclock, 
-<a name="l00124"></a>00124                                      uint8_t enable, uint8_t lines, 
-<a name="l00125"></a>00125                                      uint8_t font ) 
-<a name="l00126"></a>00126 {
-<a name="l00127"></a>00127         init ( srdata, srclock, enable, lines, font );
-<a name="l00128"></a>00128 }
-<a name="l00129"></a>00129 
-<a name="l00130"></a>00130 
-<a name="l00131"></a>00131 <span class="comment">// PRIVATE METHODS</span>
-<a name="l00132"></a>00132 <span class="comment">// ---------------------------------------------------------------------------</span>
-<a name="l00133"></a>00133 
-<a name="l00134"></a>00134 <span class="comment">//</span>
-<a name="l00135"></a>00135 <span class="comment">// init</span>
-<a name="l00136"></a>00136 <span class="keywordtype">void</span> LiquidCrystal_SR::init( uint8_t srdata, uint8_t srclock, uint8_t enable, 
-<a name="l00137"></a>00137                              uint8_t lines, uint8_t font )
-<a name="l00138"></a>00138 {
-<a name="l00139"></a>00139    <span class="comment">// Initialise private variables</span>
-<a name="l00140"></a>00140    _two_wire    = 0;
-<a name="l00141"></a>00141    _srdata_pin  = srdata; 
-<a name="l00142"></a>00142    _srclock_pin = srclock; 
-<a name="l00143"></a>00143    _enable_pin  = enable;
-<a name="l00144"></a>00144    
-<a name="l00145"></a>00145    <span class="keywordflow">if</span> (enable == <a class="code" href="_liquid_crystal___s_r_8h.html#a40fb1f76bc5f8ca9e6534b47bd6da27c">TWO_WIRE</a>)
-<a name="l00146"></a>00146    {
-<a name="l00147"></a>00147       _enable_pin = _srdata_pin;
-<a name="l00148"></a>00148       _two_wire   = 1;
-<a name="l00149"></a>00149    }
-<a name="l00150"></a>00150    
-<a name="l00151"></a>00151    <span class="comment">// Configure control pins as outputs</span>
-<a name="l00152"></a>00152    <span class="comment">// ------------------------------------------------------------------------</span>
-<a name="l00153"></a>00153    pinMode(_srclock_pin, OUTPUT);
-<a name="l00154"></a>00154    pinMode(_srdata_pin, OUTPUT);
-<a name="l00155"></a>00155    pinMode(_enable_pin, OUTPUT);
-<a name="l00156"></a>00156    
-<a name="l00157"></a>00157    <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a> = <a class="code" href="_l_c_d_8h.html#ab8c35d355d2372090c7a347e961c9224">LCD_4BITMODE</a> | <a class="code" href="_l_c_d_8h.html#a8c85cf88d8af66a47c42249d81c94641">LCD_1LINE</a> | <a class="code" href="_l_c_d_8h.html#abb3210156d88d3fe18c9352eb161fe42">LCD_5x10DOTS</a>;
-<a name="l00158"></a>00158 }
-<a name="l00159"></a>00159 
-<a name="l00160"></a>00160 <span class="comment">// PUBLIC METHODS</span>
-<a name="l00161"></a>00161 <span class="comment">// ---------------------------------------------------------------------------</span>
-<a name="l00162"></a>00162 
-<a name="l00163"></a>00163 <span class="comment">//</span>
-<a name="l00164"></a>00164 <span class="comment">// begin</span>
-<a name="l00165"></a><a class="code" href="class_liquid_crystal___s_r.html#a6fa1502e910d7e70f7a598d26963a001">00165</a> <span class="keywordtype">void</span> <a class="code" href="class_liquid_crystal___s_r.html#a6fa1502e910d7e70f7a598d26963a001">LiquidCrystal_SR::begin</a>(uint8_t cols, uint8_t lines, uint8_t dotsize) 
-<a name="l00166"></a>00166 {
-<a name="l00167"></a>00167    
-<a name="l00168"></a>00168    <span class="keywordflow">if</span> (lines &gt; 1) 
-<a name="l00169"></a>00169    {
-<a name="l00170"></a>00170       <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a> |= <a class="code" href="_l_c_d_8h.html#a7987e93538df2819583ba43b81ddbb25">LCD_2LINE</a>;
-<a name="l00171"></a>00171    }
-<a name="l00172"></a>00172 
-<a name="l00173"></a>00173    <a class="code" href="class_l_c_d.html#ac1374911fb145fea430c21092ada0c06">_numlines</a> = lines;
-<a name="l00174"></a>00174    
-<a name="l00175"></a>00175    <span class="comment">// for some 1 line displays you can select a 10 pixel high font</span>
-<a name="l00176"></a>00176    <span class="comment">// ------------------------------------------------------------</span>
-<a name="l00177"></a>00177    <span class="keywordflow">if</span> ((dotsize != 0) &amp;&amp; (lines == 1)) 
-<a name="l00178"></a>00178    {
-<a name="l00179"></a>00179       <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a> |= <a class="code" href="_l_c_d_8h.html#abb3210156d88d3fe18c9352eb161fe42">LCD_5x10DOTS</a>;
-<a name="l00180"></a>00180    }
-<a name="l00181"></a>00181    
-<a name="l00182"></a>00182    <span class="comment">// SEE PAGE 45/46 FOR INITIALIZATION SPECIFICATION!</span>
-<a name="l00183"></a>00183    <span class="comment">// according to datasheet, we need at least 40ms after power rises above 2.7V</span>
-<a name="l00184"></a>00184    <span class="comment">// before sending commands. Arduino can turn on way before 4.5V so we&#39;ll wait </span>
-<a name="l00185"></a>00185    <span class="comment">// 50</span>
-<a name="l00186"></a>00186    <span class="comment">// ---------------------------------------------------------------------------</span>
-<a name="l00187"></a>00187    delayMicroseconds(50000);
-<a name="l00188"></a>00188    init4bits(<a class="code" href="_l_c_d_8h.html#aaef882ae70d1f485cd132815d9716111">LCD_FUNCTIONSET</a> | <a class="code" href="_l_c_d_8h.html#a59a57ca857dae5d89eb5f2a38c4ac6f0">LCD_8BITMODE</a>);
-<a name="l00189"></a>00189    delayMicroseconds(4500);  <span class="comment">// wait more than 4.1ms</span>
-<a name="l00190"></a>00190    
-<a name="l00191"></a>00191    <span class="comment">// Second try</span>
-<a name="l00192"></a>00192    init4bits(<a class="code" href="_l_c_d_8h.html#aaef882ae70d1f485cd132815d9716111">LCD_FUNCTIONSET</a> | <a class="code" href="_l_c_d_8h.html#a59a57ca857dae5d89eb5f2a38c4ac6f0">LCD_8BITMODE</a>);
-<a name="l00193"></a>00193    delayMicroseconds(150);
-<a name="l00194"></a>00194    <span class="comment">// Third go</span>
-<a name="l00195"></a>00195    init4bits(<a class="code" href="_l_c_d_8h.html#aaef882ae70d1f485cd132815d9716111">LCD_FUNCTIONSET</a> | <a class="code" href="_l_c_d_8h.html#a59a57ca857dae5d89eb5f2a38c4ac6f0">LCD_8BITMODE</a>);
-<a name="l00196"></a>00196    
-<a name="l00197"></a>00197    <span class="comment">// And finally, set to 4-bit interface</span>
-<a name="l00198"></a>00198    init4bits(<a class="code" href="_l_c_d_8h.html#aaef882ae70d1f485cd132815d9716111">LCD_FUNCTIONSET</a> | <a class="code" href="_l_c_d_8h.html#ab8c35d355d2372090c7a347e961c9224">LCD_4BITMODE</a>);
-<a name="l00199"></a>00199    
-<a name="l00200"></a>00200    <span class="comment">// Set # lines, font size, etc.</span>
-<a name="l00201"></a>00201    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#aaef882ae70d1f485cd132815d9716111">LCD_FUNCTIONSET</a> | <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a>);
-<a name="l00202"></a>00202    <span class="comment">// Turn the display on with no cursor or blinking default</span>
-<a name="l00203"></a>00203    <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a> = <a class="code" href="_l_c_d_8h.html#a76236ae8317b34bbc98ea56bc0a2639c">LCD_DISPLAYON</a> | <a class="code" href="_l_c_d_8h.html#a32b194a3adaa0a0bb69acee2e6a754fa">LCD_CURSOROFF</a> | <a class="code" href="_l_c_d_8h.html#a4b28243034cec656b0ed490ba6979752">LCD_BLINKOFF</a>;
-<a name="l00204"></a>00204    <a class="code" href="class_l_c_d.html#a5b07cf05e8e5e7c53654f5ca0cf58b89">display</a>();
-<a name="l00205"></a>00205    <span class="comment">// Clear it off</span>
-<a name="l00206"></a>00206    <a class="code" href="class_l_c_d.html#afa699e0beeeee03cce8cef87eba81c4a">clear</a>();
-<a name="l00207"></a>00207    <span class="comment">// Initialize to default text direction (for romance languages)</span>
-<a name="l00208"></a>00208    <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a> = <a class="code" href="_l_c_d_8h.html#ae7c6309fce6200bd7526d090a4a84dd0">LCD_ENTRYLEFT</a> | <a class="code" href="_l_c_d_8h.html#a049ee97e98d04788c1da9a55590fbe42">LCD_ENTRYSHIFTDECREMENT</a>;
-<a name="l00209"></a>00209    <span class="comment">// set the entry mode</span>
-<a name="l00210"></a>00210    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#a5597e1d5819ea2f0734ad4313abf6703">LCD_ENTRYMODESET</a> | <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a>);
-<a name="l00211"></a>00211    <a class="code" href="class_l_c_d.html#aee45ad37f09312f5d9982257e2d37e68">home</a>();
-<a name="l00212"></a>00212    
-<a name="l00213"></a>00213 }
-<a name="l00214"></a>00214 
-<a name="l00215"></a>00215 <span class="comment">/************ low level data pushing commands **********/</span>
-<a name="l00216"></a>00216 
-<a name="l00217"></a>00217 <span class="comment">// send</span>
-<a name="l00218"></a><a class="code" href="class_liquid_crystal___s_r.html#a03821351a32db07cb7e42c8c11ce8d47">00218</a> <span class="keywordtype">void</span> <a class="code" href="class_liquid_crystal___s_r.html#a03821351a32db07cb7e42c8c11ce8d47">LiquidCrystal_SR::send</a>(uint8_t value, uint8_t mode) 
-<a name="l00219"></a>00219 {
-<a name="l00220"></a>00220    uint8_t val1, val2;
-<a name="l00221"></a>00221    
-<a name="l00222"></a>00222    <span class="comment">// If _two_wire - clear the shiftregister first.</span>
-<a name="l00223"></a>00223    <span class="comment">// ----------------------------------------------</span>
-<a name="l00224"></a>00224    <span class="keywordflow">if</span> ( _two_wire ) 
-<a name="l00225"></a>00225    {
-<a name="l00226"></a>00226       shiftOut ( _srdata_pin, _srclock_pin, MSBFIRST, 0x00 );
-<a name="l00227"></a>00227    }
-<a name="l00228"></a>00228    digitalWrite( _enable_pin, LOW );
+<a name="l00119"></a>00119 <span class="preprocessor">#ifndef FAST_MODE</span>
+<a name="l00120"></a>00120 <span class="preprocessor"></span>   delayMicroseconds ( uSec );
+<a name="l00121"></a>00121 <span class="preprocessor">#endif // FAST_MODE</span>
+<a name="l00122"></a>00122 <span class="preprocessor"></span>
+<a name="l00123"></a>00123 <span class="comment">// CONSTRUCTORS</span>
+<a name="l00124"></a>00124 <span class="comment">// ---------------------------------------------------------------------------</span>
+<a name="l00125"></a>00125 <span class="comment">// Assuming 1 line 8 pixel high font</span>
+<a name="l00126"></a>00126 <a class="code" href="class_liquid_crystal___s_r.html#a40bca9b97ad5c1e938c7dee1fd0850f2">LiquidCrystal_SR::LiquidCrystal_SR</a> ( uint8_t srdata, uint8_t srclock, 
+<a name="l00127"></a>00127                                      uint8_t enable ) 
+<a name="l00128"></a>00128 {
+<a name="l00129"></a>00129         init ( srdata, srclock, enable, 1, 0 );
+<a name="l00130"></a>00130 }
+<a name="l00131"></a>00131 <span class="comment">// Set nr. of lines, assume 8 pixel high font</span>
+<a name="l00132"></a>00132 <a class="code" href="class_liquid_crystal___s_r.html#a40bca9b97ad5c1e938c7dee1fd0850f2">LiquidCrystal_SR::LiquidCrystal_SR</a> ( uint8_t srdata, uint8_t srclock, 
+<a name="l00133"></a>00133                                      uint8_t enable, uint8_t lines ) 
+<a name="l00134"></a>00134 {
+<a name="l00135"></a>00135         init ( srdata, srclock, enable, lines, 0 );
+<a name="l00136"></a>00136 }
+<a name="l00137"></a>00137 
+<a name="l00138"></a>00138 <span class="comment">// Set nr. of lines and font</span>
+<a name="l00139"></a>00139 <a class="code" href="class_liquid_crystal___s_r.html#a40bca9b97ad5c1e938c7dee1fd0850f2">LiquidCrystal_SR::LiquidCrystal_SR</a> ( uint8_t srdata, uint8_t srclock, 
+<a name="l00140"></a>00140                                      uint8_t enable, uint8_t lines, 
+<a name="l00141"></a>00141                                      uint8_t font ) 
+<a name="l00142"></a>00142 {
+<a name="l00143"></a>00143         init ( srdata, srclock, enable, lines, font );
+<a name="l00144"></a>00144 }
+<a name="l00145"></a>00145 
+<a name="l00146"></a>00146 
+<a name="l00147"></a>00147 <span class="comment">// PRIVATE METHODS</span>
+<a name="l00148"></a>00148 <span class="comment">// ---------------------------------------------------------------------------</span>
+<a name="l00149"></a>00149 
+<a name="l00150"></a>00150 <span class="comment">//</span>
+<a name="l00151"></a>00151 <span class="comment">// init</span>
+<a name="l00152"></a>00152 <span class="keywordtype">void</span> LiquidCrystal_SR::init( uint8_t srdata, uint8_t srclock, uint8_t enable, 
+<a name="l00153"></a>00153                              uint8_t lines, uint8_t font )
+<a name="l00154"></a>00154 {
+<a name="l00155"></a>00155    <span class="comment">// Initialise private variables</span>
+<a name="l00156"></a>00156    _two_wire    = 0;
+<a name="l00157"></a>00157    _srdata_pin  = srdata; 
+<a name="l00158"></a>00158    _srclock_pin = srclock; 
+<a name="l00159"></a>00159    _enable_pin  = enable;
+<a name="l00160"></a>00160    
+<a name="l00161"></a>00161    <span class="keywordflow">if</span> (enable == <a class="code" href="_liquid_crystal___s_r_8h.html#a40fb1f76bc5f8ca9e6534b47bd6da27c">TWO_WIRE</a>)
+<a name="l00162"></a>00162    {
+<a name="l00163"></a>00163       _enable_pin = _srdata_pin;
+<a name="l00164"></a>00164       _two_wire   = 1;
+<a name="l00165"></a>00165    }
+<a name="l00166"></a>00166    
+<a name="l00167"></a>00167    <span class="comment">// Configure control pins as outputs</span>
+<a name="l00168"></a>00168    <span class="comment">// ------------------------------------------------------------------------</span>
+<a name="l00169"></a>00169    pinMode(_srclock_pin, OUTPUT);
+<a name="l00170"></a>00170    pinMode(_srdata_pin, OUTPUT);
+<a name="l00171"></a>00171    pinMode(_enable_pin, OUTPUT);
+<a name="l00172"></a>00172    
+<a name="l00173"></a>00173    <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a> = <a class="code" href="_l_c_d_8h.html#ab8c35d355d2372090c7a347e961c9224">LCD_4BITMODE</a> | <a class="code" href="_l_c_d_8h.html#a8c85cf88d8af66a47c42249d81c94641">LCD_1LINE</a> | <a class="code" href="_l_c_d_8h.html#abb3210156d88d3fe18c9352eb161fe42">LCD_5x10DOTS</a>;
+<a name="l00174"></a>00174 }
+<a name="l00175"></a>00175 
+<a name="l00176"></a>00176 <span class="comment">// PUBLIC METHODS</span>
+<a name="l00177"></a>00177 <span class="comment">// ---------------------------------------------------------------------------</span>
+<a name="l00178"></a>00178 
+<a name="l00179"></a>00179 <span class="comment">//</span>
+<a name="l00180"></a>00180 <span class="comment">// begin</span>
+<a name="l00181"></a>00181 <span class="keywordtype">void</span> <a class="code" href="class_liquid_crystal___s_r.html#a93711b39537e3d6e4321eb312be0feff">LiquidCrystal_SR::begin</a>(uint8_t cols, uint8_t lines, uint8_t dotsize) 
+<a name="l00182"></a>00182 {
+<a name="l00183"></a>00183    
+<a name="l00184"></a>00184    <span class="keywordflow">if</span> (lines &gt; 1) 
+<a name="l00185"></a>00185    {
+<a name="l00186"></a>00186       <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a> |= <a class="code" href="_l_c_d_8h.html#a7987e93538df2819583ba43b81ddbb25">LCD_2LINE</a>;
+<a name="l00187"></a>00187    }
+<a name="l00188"></a>00188 
+<a name="l00189"></a>00189    <a class="code" href="class_l_c_d.html#ac1374911fb145fea430c21092ada0c06">_numlines</a> = lines;
+<a name="l00190"></a>00190    <a class="code" href="class_l_c_d.html#a88b16ea0e5c7d1cabc5007d48bcbd2b0">_cols</a> = cols;
+<a name="l00191"></a>00191    
+<a name="l00192"></a>00192    <span class="comment">// for some 1 line displays you can select a 10 pixel high font</span>
+<a name="l00193"></a>00193    <span class="comment">// ------------------------------------------------------------</span>
+<a name="l00194"></a>00194    <span class="keywordflow">if</span> ((dotsize != 0) &amp;&amp; (lines == 1)) 
+<a name="l00195"></a>00195    {
+<a name="l00196"></a>00196       <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a> |= <a class="code" href="_l_c_d_8h.html#abb3210156d88d3fe18c9352eb161fe42">LCD_5x10DOTS</a>;
+<a name="l00197"></a>00197    }
+<a name="l00198"></a>00198    
+<a name="l00199"></a>00199    <span class="comment">// SEE PAGE 45/46 FOR INITIALIZATION SPECIFICATION!</span>
+<a name="l00200"></a>00200    <span class="comment">// according to datasheet, we need at least 40ms after power rises above 2.7V</span>
+<a name="l00201"></a>00201    <span class="comment">// before sending commands. Arduino can turn on way before 4.5V so we&#39;ll wait </span>
+<a name="l00202"></a>00202    <span class="comment">// 50</span>
+<a name="l00203"></a>00203    <span class="comment">// ---------------------------------------------------------------------------</span>
+<a name="l00204"></a>00204    delayMicroseconds(50000);
+<a name="l00205"></a>00205    init4bits(<a class="code" href="_l_c_d_8h.html#aaef882ae70d1f485cd132815d9716111">LCD_FUNCTIONSET</a> | <a class="code" href="_l_c_d_8h.html#a59a57ca857dae5d89eb5f2a38c4ac6f0">LCD_8BITMODE</a>);
+<a name="l00206"></a>00206    delayMicroseconds(4500);  <span class="comment">// wait more than 4.1ms</span>
+<a name="l00207"></a>00207    
+<a name="l00208"></a>00208    <span class="comment">// Second try</span>
+<a name="l00209"></a>00209    init4bits(<a class="code" href="_l_c_d_8h.html#aaef882ae70d1f485cd132815d9716111">LCD_FUNCTIONSET</a> | <a class="code" href="_l_c_d_8h.html#a59a57ca857dae5d89eb5f2a38c4ac6f0">LCD_8BITMODE</a>);
+<a name="l00210"></a>00210    delayMicroseconds(150);
+<a name="l00211"></a>00211    <span class="comment">// Third go</span>
+<a name="l00212"></a>00212    init4bits(<a class="code" href="_l_c_d_8h.html#aaef882ae70d1f485cd132815d9716111">LCD_FUNCTIONSET</a> | <a class="code" href="_l_c_d_8h.html#a59a57ca857dae5d89eb5f2a38c4ac6f0">LCD_8BITMODE</a>);
+<a name="l00213"></a>00213    
+<a name="l00214"></a>00214    <span class="comment">// And finally, set to 4-bit interface</span>
+<a name="l00215"></a>00215    init4bits(<a class="code" href="_l_c_d_8h.html#aaef882ae70d1f485cd132815d9716111">LCD_FUNCTIONSET</a> | <a class="code" href="_l_c_d_8h.html#ab8c35d355d2372090c7a347e961c9224">LCD_4BITMODE</a>);
+<a name="l00216"></a>00216    
+<a name="l00217"></a>00217    <span class="comment">// Set # lines, font size, etc.</span>
+<a name="l00218"></a>00218    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#aaef882ae70d1f485cd132815d9716111">LCD_FUNCTIONSET</a> | <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a>);
+<a name="l00219"></a>00219    <span class="comment">// Turn the display on with no cursor or blinking default</span>
+<a name="l00220"></a>00220    <a class="code" href="class_l_c_d.html#ae47a0e2eff74431a39774b788d5761f4">_displaycontrol</a> = <a class="code" href="_l_c_d_8h.html#a76236ae8317b34bbc98ea56bc0a2639c">LCD_DISPLAYON</a> | <a class="code" href="_l_c_d_8h.html#a32b194a3adaa0a0bb69acee2e6a754fa">LCD_CURSOROFF</a> | <a class="code" href="_l_c_d_8h.html#a4b28243034cec656b0ed490ba6979752">LCD_BLINKOFF</a>;
+<a name="l00221"></a>00221    <a class="code" href="class_l_c_d.html#a5b07cf05e8e5e7c53654f5ca0cf58b89">display</a>();
+<a name="l00222"></a>00222    <span class="comment">// Clear it off</span>
+<a name="l00223"></a>00223    <a class="code" href="class_l_c_d.html#afa699e0beeeee03cce8cef87eba81c4a">clear</a>();
+<a name="l00224"></a>00224    <span class="comment">// Initialize to default text direction (for romance languages)</span>
+<a name="l00225"></a>00225    <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a> = <a class="code" href="_l_c_d_8h.html#ae7c6309fce6200bd7526d090a4a84dd0">LCD_ENTRYLEFT</a> | <a class="code" href="_l_c_d_8h.html#a049ee97e98d04788c1da9a55590fbe42">LCD_ENTRYSHIFTDECREMENT</a>;
+<a name="l00226"></a>00226    <span class="comment">// set the entry mode</span>
+<a name="l00227"></a>00227    <a class="code" href="class_l_c_d.html#a31a0cb42497d83cdc9cb8000828f7190">command</a>(<a class="code" href="_l_c_d_8h.html#a5597e1d5819ea2f0734ad4313abf6703">LCD_ENTRYMODESET</a> | <a class="code" href="class_l_c_d.html#a726b9a68d091dd8683a18e83f3a8fd3c">_displaymode</a>);
+<a name="l00228"></a>00228    <a class="code" href="class_l_c_d.html#aee45ad37f09312f5d9982257e2d37e68">home</a>();
 <a name="l00229"></a>00229    
-<a name="l00230"></a>00230    mode = mode ? <a class="code" href="_liquid_crystal___s_r_8h.html#afdaa2bbb2cc185700864ac8d7a570ced">SR_RS_BIT</a> : 0; <span class="comment">// RS bit; LOW: command.  HIGH: character.</span>
-<a name="l00231"></a>00231    val1 = mode | <a class="code" href="_liquid_crystal___s_r_8h.html#a0075b041d82abb47f279dce482e7b087">SR_EN_BIT</a> | ((value &gt;&gt; 1) &amp; 0x78); <span class="comment">// upper nibble</span>
-<a name="l00232"></a>00232    val2 = mode | <a class="code" href="_liquid_crystal___s_r_8h.html#a0075b041d82abb47f279dce482e7b087">SR_EN_BIT</a> | ((value &lt;&lt; 3) &amp; 0x78); <span class="comment">// lower nibble</span>
-<a name="l00233"></a>00233    
-<a name="l00234"></a>00234    shiftOut ( _srdata_pin, _srclock_pin, MSBFIRST, val1 );
-<a name="l00235"></a>00235    
-<a name="l00236"></a>00236    digitalWrite( _enable_pin, HIGH );
-<a name="l00237"></a>00237    delayMicroseconds(1);                 <span class="comment">// enable pulse must be &gt;450ns</span>
-<a name="l00238"></a>00238    digitalWrite( _enable_pin, LOW );
-<a name="l00239"></a>00239 
-<a name="l00240"></a>00240    <span class="comment">// clear shiftregister</span>
-<a name="l00241"></a>00241    <span class="comment">// ---------------------------</span>
-<a name="l00242"></a>00242    <span class="keywordflow">if</span> ( _two_wire ) 
-<a name="l00243"></a>00243    {
-<a name="l00244"></a>00244       shiftOut ( _srdata_pin, _srclock_pin, MSBFIRST, 0x00 ); 
-<a name="l00245"></a>00245    }
-<a name="l00246"></a>00246    shiftOut ( _srdata_pin, _srclock_pin, MSBFIRST, val2 );
-<a name="l00247"></a>00247    
-<a name="l00248"></a>00248    digitalWrite( _enable_pin, HIGH );
-<a name="l00249"></a>00249    delayMicroseconds(1);                 <span class="comment">// enable pulse must be &gt;450ns</span>
-<a name="l00250"></a>00250    digitalWrite( _enable_pin, LOW );
-<a name="l00251"></a>00251    delayMicroseconds(40);                <span class="comment">// commands need &gt; 37us to settle</span>
-<a name="l00252"></a>00252 }
-<a name="l00253"></a>00253 
-<a name="l00254"></a>00254 <span class="comment">//</span>
-<a name="l00255"></a>00255 <span class="comment">// init4bits</span>
-<a name="l00256"></a>00256 <span class="keywordtype">void</span> LiquidCrystal_SR::init4bits(uint8_t value) 
-<a name="l00257"></a>00257 {
-<a name="l00258"></a>00258    uint8_t val1;
-<a name="l00259"></a>00259    
-<a name="l00260"></a>00260    <span class="comment">// clear shiftregister</span>
-<a name="l00261"></a>00261    <span class="comment">// --------------------------</span>
-<a name="l00262"></a>00262    <span class="keywordflow">if</span> ( _two_wire ) 
-<a name="l00263"></a>00263    {
-<a name="l00264"></a>00264       shiftOut ( _srdata_pin, _srclock_pin, MSBFIRST, 0x00 ); 
-<a name="l00265"></a>00265    }
-<a name="l00266"></a>00266    digitalWrite( _enable_pin, LOW );
-<a name="l00267"></a>00267    
-<a name="l00268"></a>00268    val1 = <a class="code" href="_liquid_crystal___s_r_8h.html#a0075b041d82abb47f279dce482e7b087">SR_EN_BIT</a> | ((value &gt;&gt; 1) &amp; 0x78);
-<a name="l00269"></a>00269    shiftOut ( _srdata_pin, _srclock_pin, MSBFIRST, val1 );
-<a name="l00270"></a>00270    
-<a name="l00271"></a>00271    digitalWrite( _enable_pin, HIGH );
-<a name="l00272"></a>00272    delayMicroseconds(1);                 <span class="comment">// enable pulse must be &gt;450ns</span>
-<a name="l00273"></a>00273    digitalWrite( _enable_pin, LOW );
-<a name="l00274"></a>00274    
-<a name="l00275"></a>00275    delayMicroseconds(40);               <span class="comment">// commands need &gt; 37us to settle</span>
-<a name="l00276"></a>00276 }
-<a name="l00277"></a>00277 
-<a name="l00278"></a>00278 
-<a name="l00279"></a>00279 
+<a name="l00230"></a>00230 }
+<a name="l00231"></a>00231 
+<a name="l00232"></a>00232 <span class="comment">/************ low level data pushing commands **********/</span>
+<a name="l00233"></a>00233 
+<a name="l00234"></a>00234 <span class="comment">// send</span>
+<a name="l00235"></a>00235 <span class="keywordtype">void</span> <a class="code" href="class_liquid_crystal___s_r.html#a015d4b0660ea866c5024adecb1fcf01b">LiquidCrystal_SR::send</a>(uint8_t value, uint8_t mode) 
+<a name="l00236"></a>00236 {
+<a name="l00237"></a>00237    uint8_t val1, val2;
+<a name="l00238"></a>00238    
+<a name="l00239"></a>00239    <span class="comment">// If _two_wire - clear the shiftregister first.</span>
+<a name="l00240"></a>00240    <span class="comment">// ----------------------------------------------</span>
+<a name="l00241"></a>00241    <span class="keywordflow">if</span> ( _two_wire ) 
+<a name="l00242"></a>00242    {
+<a name="l00243"></a>00243       shiftOut ( _srdata_pin, _srclock_pin, MSBFIRST, 0x00 );
+<a name="l00244"></a>00244    }
+<a name="l00245"></a>00245    digitalWrite( _enable_pin, LOW );
+<a name="l00246"></a>00246    
+<a name="l00247"></a>00247    mode = mode ? <a class="code" href="_liquid_crystal___s_r_8h.html#afdaa2bbb2cc185700864ac8d7a570ced">SR_RS_BIT</a> : 0; <span class="comment">// RS bit; LOW: command.  HIGH: character.</span>
+<a name="l00248"></a>00248    val1 = mode | <a class="code" href="_liquid_crystal___s_r_8h.html#a0075b041d82abb47f279dce482e7b087">SR_EN_BIT</a> | ((value &gt;&gt; 1) &amp; 0x78); <span class="comment">// upper nibble</span>
+<a name="l00249"></a>00249    val2 = mode | <a class="code" href="_liquid_crystal___s_r_8h.html#a0075b041d82abb47f279dce482e7b087">SR_EN_BIT</a> | ((value &lt;&lt; 3) &amp; 0x78); <span class="comment">// lower nibble</span>
+<a name="l00250"></a>00250    
+<a name="l00251"></a>00251    shiftOut ( _srdata_pin, _srclock_pin, MSBFIRST, val1 );
+<a name="l00252"></a>00252    
+<a name="l00253"></a>00253    digitalWrite( _enable_pin, HIGH );
+<a name="l00254"></a>00254    <a class="code" href="_liquid_crystal___s_r_8cpp.html#a6eac41e4be58d7736ac0c19de225c0dc">waitUsec</a>( 1 );                 <span class="comment">// enable pulse must be &gt;450ns</span>
+<a name="l00255"></a>00255    digitalWrite( _enable_pin, LOW );
+<a name="l00256"></a>00256 
+<a name="l00257"></a>00257    <span class="comment">// clear shiftregister</span>
+<a name="l00258"></a>00258    <span class="comment">// ---------------------------</span>
+<a name="l00259"></a>00259    <span class="keywordflow">if</span> ( _two_wire ) 
+<a name="l00260"></a>00260    {
+<a name="l00261"></a>00261       shiftOut ( _srdata_pin, _srclock_pin, MSBFIRST, 0x00 ); 
+<a name="l00262"></a>00262    }
+<a name="l00263"></a>00263    shiftOut ( _srdata_pin, _srclock_pin, MSBFIRST, val2 );
+<a name="l00264"></a>00264    
+<a name="l00265"></a>00265    digitalWrite( _enable_pin, HIGH );
+<a name="l00266"></a>00266    <a class="code" href="_liquid_crystal___s_r_8cpp.html#a6eac41e4be58d7736ac0c19de225c0dc">waitUsec</a>( 1 );                 <span class="comment">// enable pulse must be &gt;450ns</span>
+<a name="l00267"></a>00267    digitalWrite( _enable_pin, LOW );
+<a name="l00268"></a>00268    <a class="code" href="_liquid_crystal___s_r_8cpp.html#a6eac41e4be58d7736ac0c19de225c0dc">waitUsec</a>( 40 );                <span class="comment">// commands need &gt; 37us to settle</span>
+<a name="l00269"></a>00269 }
+<a name="l00270"></a>00270 
+<a name="l00271"></a>00271 <span class="comment">//</span>
+<a name="l00272"></a>00272 <span class="comment">// init4bits</span>
+<a name="l00273"></a>00273 <span class="keywordtype">void</span> LiquidCrystal_SR::init4bits(uint8_t value) 
+<a name="l00274"></a>00274 {
+<a name="l00275"></a>00275    uint8_t val1;
+<a name="l00276"></a>00276    
+<a name="l00277"></a>00277    <span class="comment">// clear shiftregister</span>
+<a name="l00278"></a>00278    <span class="comment">// --------------------------</span>
+<a name="l00279"></a>00279    <span class="keywordflow">if</span> ( _two_wire ) 
+<a name="l00280"></a>00280    {
+<a name="l00281"></a>00281       shiftOut ( _srdata_pin, _srclock_pin, MSBFIRST, 0x00 ); 
+<a name="l00282"></a>00282    }
+<a name="l00283"></a>00283    digitalWrite( _enable_pin, LOW );
+<a name="l00284"></a>00284    
+<a name="l00285"></a>00285    val1 = <a class="code" href="_liquid_crystal___s_r_8h.html#a0075b041d82abb47f279dce482e7b087">SR_EN_BIT</a> | ((value &gt;&gt; 1) &amp; 0x78);
+<a name="l00286"></a>00286    shiftOut ( _srdata_pin, _srclock_pin, MSBFIRST, val1 );
+<a name="l00287"></a>00287    
+<a name="l00288"></a>00288    digitalWrite( _enable_pin, HIGH );
+<a name="l00289"></a>00289    <a class="code" href="_liquid_crystal___s_r_8cpp.html#a6eac41e4be58d7736ac0c19de225c0dc">waitUsec</a>( 1 );                 <span class="comment">// enable pulse must be &gt;450ns</span>
+<a name="l00290"></a>00290    digitalWrite( _enable_pin, LOW );
+<a name="l00291"></a>00291    
+<a name="l00292"></a>00292    <a class="code" href="_liquid_crystal___s_r_8cpp.html#a6eac41e4be58d7736ac0c19de225c0dc">waitUsec</a>( 40 );               <span class="comment">// commands need &gt; 37us to settle</span>
+<a name="l00293"></a>00293 }
+<a name="l00294"></a>00294 
+<a name="l00295"></a>00295 
+<a name="l00296"></a>00296 
 </pre></div></div>
 </div>
 <!-- window showing the filter options -->
 </iframe>
 </div>
 
-<hr class="footer"/><address class="footer"><small>Generated on Sat Nov 19 2011 20:59:21 for LCD Library by&#160;
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jan 6 2012 14:21:03 for LCD Library by&#160;
 <a href="http://www.doxygen.org/index.html">
 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>