Commun sense for LCD

Hello,
How can I save energy when I do not look at my LCD display?
When you want to use an LCD with I2C support, you MUST turn on some light in the back with the instruction:
lcd.backlight();
after that, the LCD will stay illuminated for ever, until power off.
There is no such an instruction like: lcd.backlight(OFF); to save energy.
Honestly why implement power(on) when there is no power(off) switch?
I am a dinosaurs as I started working in 1968 for a major IT firm.
I2C libray should be reviewed and extended to support such a function.

You can use the command lcd.noBacklight();. Also can you provide the code?

Here is test code I use. It has most of the LCD PCF8574 driver instructions. It has been working for eight years and still does on new projects. I write test code for each piece of hardware first so I understand how to control it. I am an assembler programmer, not C++ so it is mainly in assembler format. If you follow the code you will see where I initialize the I2C and other pieces of hardware.

// 151028 - 151020 - 151018 LCD16X4


/*******************************************************************************
*    11/8/15 - 10/20/28 - 10/10/2015                                           *
*                                                                              *
*         This drives Drives a 20X4 display (1604) via the I2C bus using a     *
*         PCF85741 which directly connects to the display.It supports a        *
*         Back-light function allowing it to be turned on or off.              *
*                                                                              *
*         Two libraries are Required, wire.h and LiquidCrystal_I2C.h           *
*                                                                              *
*    For my convenience when the display is initialized it will display the    *
*    File name, Date of compilation, and of course says hello to me:-)         *
*                                                                              *
*    SCL Pin-17,  SDA  Pin-16 +5 and Ground are the only connections from the  *
*    Display.   I2C is at 68H                                                  *
*                                                                              *
*    It receives text via the serial monitor.  That data is then displayed     *
*    for a period of time.  Turn of line ending (no line ending).  If this     *
*    is mis-configured no damage, just goofy characters at end of message.     *
*                                                                              *
********************************************************************************/
#include <Wire.h>                   // Add the wire Library
#include <LiquidCrystal_I2C.h>      // We need this library for the LCD

/***********************************************************************
*                                                                      *
*     Set up the software to match the display.  Then initialize it.   *
*                                                                      *
*     In this case it is at address Hex 27(9x27).  It is built as      *
*     20 Columns with 4 Rows.                                          *
*                                                                      *
***********************************************************************/
LiquidCrystal_I2C lcd(0x27, 20, 4);  // Tells the Software what the Display is

/***********************************************************************
*                                                                      *
*     Initialize all the variables and tell the world Hello.           *
*                                                                      *
*    And for my convenience the File name, Date of compilation, and    *
*    of course says hello to me:-)                                     *
*                                                                      *
************************************************************************/
void setup()
{
  Serial.begin(115200);                // Set up the serial Baud rate
  Serial.println("\n Good Day Gil! This is the [ LCD Sketch ]");
  Serial.println("\tLCD20X4 - 151028\n");


  // initialize the LCD
/********************************************************************************************************
*                                                                                                       *
*   Set up the display to our preferences, it is ready to go.                                           *
*                                                                                                       *
*              The first three functions must  be performed in order before the others                  *
*                                                                                                       *
* #include <LiquidCrystal_I2C.h>          Must have to allow functions to work.                         *
*   LiquidCrystal_I2C lcd(0x27, 20, 4);  LCD (Address, rows, columns) 0-n                               *
*   lcd.begin();           This wakes up the hardware so we can control the Display                     *
*   lcd.noBacklight();     We can shut the back-light of if wanted                                      *
*   lcd.backlight();       Or we can turn the back-light on if wanted and jumper in place.              *
*   lcd.clear();           This will clear the display and get rid of any unwanted characters.          *
*   lcd.home();            Moves the cursor to row 0, column 0, (top left corner)                       *
*   lcd.setCursor(0, 1);   Position cursor (column, row) Row and column start with zero                 *
*   lcd.write():           Writes a byte and returns the number written (optional to use)               *
*   lcd.print"string");    Prints a string starting at the current cursor position                      *
*   lcd.print(data, BASE); Prints a number at the current cursor location.                              *
*                              data: (char,byte, int, long, or string)                                  *
*                              BASE: (BIN,DEC, OCT, HEX)                                                *
*   lcd.setCursor(c, r);   Position cursor column (position form left) and row (rows from top).         *
*   lcd.cursor();          Show cursor at next position to be written.                                  *
*   lcd,blink();           Display blinking cursor if used with cursor function. Display dependent      *
*   lcd.noBlink();        Turns off the blinking cursor.                                                *
*   lcd.Display();        Turns on the character portion of the display.                                *
*   lcd.noDisplay();      Turns off the charactor portion of the display.                               *
*   scrollDisplayLeft();  Scrolls the display contents & cursor 1 space to the left.                    *
*   scrollDisplayRight(); Scrolls the display contents & cursor 1 space to the right.                   *
*   autoscroll();         Causes each character output to push previous character over 1 space.         *
*   noAutoscroll();       Turns off the auto scroll                                                     *
*   leftToRight();        Default: sets the direction for text, left to right.                          *
*   rightToLeft();        Sets the direction for test to right to left                                  *
*   lcd.createChar(num,data); create a custom character (gylph) up to 8 5x8 pixels are supported (0-7)  *
*                              byte smiley[8] = {                                                       *
*                                 B00000,                                                               *
*                                 B10001,                  void setup() {                               *
*                                 B00000,                  lcd.creatChar(o, smiley);                    *
*                                 B00000,                  lcd.begin(16,2);                             *
*                                 B10001,                  lcd.write(byte(0));                          *
*                                 B01110,                  }                                            *
*                                 B00000,                                                               *
*                                 }                                                                     *
                                                                                                        *
*********************************************************************************************************/
  lcd.begin();                      // First thing wake it up
  lcd.noBacklight();                // We can shut the back light off is wanted
  lcd.noBlink();                    // We do not want the cursor blinking
  lcd.clear();                      // Clear the display get rid of any junk
  lcd.noAutoscroll();               // Turn off the auto scroll
  lcd.backlight();                  // This turns on the Backlight
 // lcd.blink();                      // Have the cursor blink
  lcd.print("Good Afternoon Gil!"); // This is the length of the displayed line
  lcd.setCursor ( 0, 1 );           // Position Cursor Column and Row
  lcd.print("-------------------"); // This is the length of the displayed line
  lcd.setCursor ( 0, 2 );           // Position Cursor Column and Row
  lcd.print("   File: LCD20x4   "); // This is the length of the displayed line
  lcd.setCursor ( 0, 3);            // Position Cursor Column and Row
  lcd.print("     11/8/2015     "); // A blank line
  delay(5500);                      // Time to read the hello message
  lcd.backlight();                  // We turn the backlight back on
}

/***********************************************************************
*                                                                      *
*     This is the main program the display is all set up and the       *
*     hello message has been displayed!                                *
*      Currently it simply displays a repeating message!               *
*                                                                      *
***********************************************************************/
void loop()                         // We get into our main program
{
  lcd.setCursor ( 0, 3 );            // Position Cursor Column and Row
  lcd.print("Good Afternoon Gil!");  // This is the length of the displayed line
  lcd.setCursor ( 0, 2 );            // Position Cursor Column and Row
  lcd.print("--------------------"); // This is the length of the displayed line
  lcd.setCursor ( 0, 1 );            // Position Cursor Column and Row
  lcd.print("This is Getting Hot!"); // This is the length of the displayed line
  lcd.setCursor ( 0, 0 );            // Position Cursor Column and Row
  lcd.print("We Have it Operating"); // This is the length of the displayed line   
  delay(2600);                       // Time to allow the display to be read

  lcd.setCursor ( 0, 2 );            // Position Cursor Column and Row
  lcd.print("===================="); // This is the length of the displayed line
  lcd.setCursor ( 0, 3 );            // Position Cursor Column and Row
  lcd.print("    Hello Betty!    "); // This is the length of the displayed line   
  delay (3300);                      // Time to allow the display to be read

/***********************************************************************
*                                                                      *
*    If characters arrived over the serial port... Send them to the    *
*    display and keep them displayed for a short period.               *
*                                                                      *
***********************************************************************/
  if (Serial.available()) {           // See if we have any data
    delay(100);	                      // Wait for the entire message to arrive
    lcd.clear();		      // Clear the screen
    lcd.backlight();                  // Turn on the Backlight
    lcd.setCursor ( 0, 3 );           // Position Cursor Column and Row
 
/*************************************************************************
*                                                                        *
*    Write all characters received with the serial port to the display.  *
*    display and keep them displayed for a short period.                 *
*                                                                        *
**************************************************************************/
    while (Serial.available() > 0) {  // Go until all are read
      lcd.write(Serial.read());       // one character at a time
    }
    delay (3900);                     // Give time to read message
  }
}  /* End of LCD20x4  */

 

Some one suggested a simple solution :

lcd.noBacklight();

Thankyou

Mod edit: personal details redacted

gilshultz
September 11 |

  • | - |

Here is test code I use. It has most of the LCD PCF8574 driver instructions. It has been working for eight years and still does on new projects. I write test code for each piece of hardware first so I understand how to control it. I am an assembler programmer, not C++ so it is mainly in assembler format. If you follow the code you will see where I initialize the I2C and other pieces of hardware.

// 151028 - 151020 - 151018 LCD16X4

/*******************************************************************************
*    11/8/15 - 10/20/28 - 10/10/2015                                           *
*                                                                              *
*         This drives Drives a 20X4 display (1604) via the I2C bus using a     *
*         PCF85741 which directly connects to the display.It supports a        *
*         Back-light function allowing it to be turned on or off.              *
*                                                                              *
*         Two libraries are Required, wire.h and LiquidCrystal_I2C.h           *
*                                                                              *
*    For my convenience when the display is initialized it will display the    *
*    File name, Date of compilation, and of course says hello to me:-)         *
*                                                                              *
*    SCL Pin-17,  SDA  Pin-16 +5 and Ground are the only connections from the  *
*    Display.   I2C is at 68H                                                  *
*                                                                              *
*    It receives text via the serial monitor.  That data is then displayed     *
*    for a period of time.  Turn of line ending (no line ending).  If this     *
*    is mis-configured no damage, just goofy characters at end of message.     *
*                                                                              *
********************************************************************************/
#include <Wire.h>                   // Add the wire Library
#include <LiquidCrystal_I2C.h>      // We need this library for the LCD

/***********************************************************************
*                                                                      *
*     Set up the software to match the display.  Then initialize it.   *
*                                                                      *
*     In this case it is at address Hex 27(9x27).  It is built as      *
*     20 Columns with 4 Rows.                                          *
*                                                                      *
***********************************************************************/
LiquidCrystal_I2C lcd(0x27, 20, 4);  // Tells the Software what the Display is

/***********************************************************************
*                                                                      *
*     Initialize all the variables and tell the world Hello.           *
*                                                                      *
*    And for my convenience the File name, Date of compilation, and    *
*    of course says hello to me:-)                                     *
*                                                                      *
************************************************************************/
void setup()
{
  Serial.begin(115200);                // Set up the serial Baud rate
  Serial.println("\n Good Day Gil! This is the [ LCD Sketch ]");
  Serial.println("\tLCD20X4 - 151028\n");

  // initialize the LCD
/********************************************************************************************************
*                                                                                                       *
*   Set up the display to our preferences, it is ready to go.                                           *
*                                                                                                       *
*              The first three functions must  be performed in order before the others                  *
*                                                                                                       *
* #include <LiquidCrystal_I2C.h>          Must have to allow functions to work.                         *
*   LiquidCrystal_I2C lcd(0x27, 20, 4);  LCD (Address, rows, columns) 0-n                               *
*   lcd.begin();           This wakes up the hardware so we can control the Display                     *
*   lcd.noBacklight();     We can shut the back-light of if wanted                                      *
*   lcd.backlight();       Or we can turn the back-light on if wanted and jumper in place.              *
*   lcd.clear();           This will clear the display and get rid of any unwanted characters.          *
*   lcd.home();            Moves the cursor to row 0, column 0, (top left corner)                       *
*   lcd.setCursor(0, 1);   Position cursor (column, row) Row and column start with zero                 *
*   lcd.write():           Writes a byte and returns the number written (optional to use)               *
*   lcd.print"string");    Prints a string starting at the current cursor position                      *
*   lcd.print(data, BASE); Prints a number at the current cursor location.                              *
*                              data: (char,byte, int, long, or string)                                  *
*                              BASE: (BIN,DEC, OCT, HEX)                                                *
*   lcd.setCursor(c, r);   Position cursor column (position form left) and row (rows from top).         *
*   lcd.cursor();          Show cursor at next position to be written.                                  *
*   lcd,blink();           Display blinking cursor if used with cursor function. Display dependent      *
*   lcd.noBlink();        Turns off the blinking cursor.                                                *
*   lcd.Display();        Turns on the character portion of the display.                                *
*   lcd.noDisplay();      Turns off the charactor portion of the display.                               *
*   scrollDisplayLeft();  Scrolls the display contents & cursor 1 space to the left.                    *
*   scrollDisplayRight(); Scrolls the display contents & cursor 1 space to the right.                   *
*   autoscroll();         Causes each character output to push previous character over 1 space.         *
*   noAutoscroll();       Turns off the auto scroll                                                     *
*   leftToRight();        Default: sets the direction for text, left to right.                          *
*   rightToLeft();        Sets the direction for test to right to left                                  *
*   lcd.createChar(num,data); create a custom character (gylph) up to 8 5x8 pixels are supported (0-7)  *
*                              byte smiley[8] = {                                                       *
*                                 B00000,                                                               *
*                                 B10001,                  void setup() {                               *
*                                 B00000,                  lcd.creatChar(o, smiley);                    *
*                                 B00000,                  lcd.begin(16,2);                             *
*                                 B10001,                  lcd.write(byte(0));                          *
*                                 B01110,                  }                                            *
*                                 B00000,                                                               *
*                                 }                                                                     *

If you use the hd44780 library, it comes with lots of documentation, including a wiki.
The hd44780 library is LiquidCrystal and LCD API 1.0 compatible with some additional extensions.
In the hd44780 library, there are also API calls to turn off the pixels as well as backlight to save a little bit more power.
off() and on()
Here is a link to the hd44780 library API documentation:

Here is info in the library:

and info on the i/o class for the type of LCD device you have:

And a link to the readme which has more technical information about the library.

The library comes with a Documentation sketch that allows bringing up the documentation links in the IDE GUI.
(some this doesn't work correctly on IDE 2.x due to issues in the 2.x IDE)

--- bill

Thankyou for referencing an extanded tool.
Someone suggested a much simpler solution:

lcd.noBacklight();

which covers my need.
Regard

Mod edit: personal details redacted

bperrybap
September 12 |

  • | - |

If you use the hd44780 library, it comes with lots of documentation, including a wiki.
The hd44780 library is LiquidCrystal and LCD API 1.0 compatible with some additional extensions.
In the hd44780 library, there are also API calls to turn off the pixels as well as backlight to save a little bit more power.
off() and on()
Here is a link to the hd44780 library API documentation:

GitHub

GitHub - duinoWitchery/hd44780: Extensible hd44780 LCD library

Extensible hd44780 LCD library. Contribute to duinoWitchery/hd44780 development by creating an account on GitHub.

Here is info in the library:

GitHub

Home

Extensible hd44780 LCD library. Contribute to duinoWitchery/hd44780 development by creating an account on GitHub.

and info on the i/o class for the type of LCD device you have:

GitHub

ioClass: hd44780_I2Cexp

Extensible hd44780 LCD library. Contribute to duinoWitchery/hd44780 development by creating an account on GitHub.

And a link to the readme which has more technical information about the library.

GitHub

GitHub - duinoWitchery/hd44780: Extensible hd44780 LCD library

Extensible hd44780 LCD library. Contribute to duinoWitchery/hd44780 development by creating an account on GitHub.

The library comes with a Documentation sketch that allows bringing up the documentation links in the IDE GUI.
(some this doesn't work correctly on IDE 2.x due to issues in the 2.x IDE)

--- bill

I assume you were replying back to me.
I wasn't suggesting an extended tool.
You had asked:

How can I save energy when I do not look at my LCD display?

So I was suggesting a way to save the most power.
I was suggesting using a different lcd library to pick up some new API capabilities to and have the ability to save a bit more power beyond turning off the backlight.

In terms of API, the hd44780 library has the same API functions as LiquidCrystal_I2C since both are based on LCD API 1.0
However hd44780 has additional features as it is a more complete LCD API 1.0 implementation.
hd44780 also has documentation.

The hd44780 library is also actively maintained (LiquidCrystal_I2C is no longer maintained) and the hd44780 library is quite a bit faster and has some additional capabilties like status codes and the ability to do automatic line wrapping.

In terms of simpler, using what I was suggesting is no more complex.
What I was suggesting was that if you used the hd44780 library, you not only would have access to backlight() and noBacklight() API functions but also would have on() and off() API functions which could save you a little bit more more power.

i.e.
lcd.off() and lcd.on()
where off() (as noted in the hd44780 library and LCD API 1.0 documentation) turns off the pixels (display) and the backlight
and on() turns them both on.
Turning off the display puts the hd44780 chip into a lower power state.

Here is a link to information about LCD API 1.0
https://playground.arduino.cc/Code/LCDAPI/?_gl=1*1e8bgkm*_ga*MjA4MjcyMDA2NS4xNjYxOTczMzMx*_ga_NEXN8H46L5*MTY5NDU0ODcxOC44OTcuMS4xNjk0NTQ5NzQ4LjAuMC4w

--- bill

Thankyou for the many good reasons to switch to hd44780.
best regards

Mod edit: personal details redacted

| bperrybap
September 12 |

  • | - |

I assume you were replying back to me.
I wasn't suggesting an extended tool.
You had asked:

How can I save energy when I do not look at my LCD display?

So I was suggesting a way to save the most power.
I was suggesting using a different lcd library to pick up some new API capabilities to and have the ability to save a bit more power beyond turning off the backlight.

In terms of API, the hd44780 library has the same API functions as LiquidCrystal_I2C since both are based on LCD API 1.0
However hd44780 has additional features as it is a more complete LCD API 1.0 implementation.
hd44780 also has documentation.

The hd44780 library is also actively maintained (LiquidCrystal_I2C is no longer maintained) and the hd44780 library is quite a bit faster and has some additional capabilties like status codes and the ability to do automatic line wrapping.

In terms of simpler, using what I was suggesting is no more complex.
What I was suggesting was that if you used the hd44780 library, you not only would have not only have access to backlight() and noBacklight() API functions but also would have on() and off() API functions which could save you a little bit more more power.

i.e.
lcd.off() and lcd.on()
where off() (as noted in the hd44780 and LCD API 1.0 documentation) turns off the pixels (display) and the backlight
and on() turns them both on.
Turning off the display puts the hd44780 chip into a lower power state.

Here is a link to information about LCD API 1.0
https://playground.arduino.cc/Code/LCDAPI/?_gl=11e8bgkm_gaMjA4MjcyMDA2NS4xNjYxOTczMzMx_ga_NEXN8H46L5*MTY5NDU0ODcxOC44OTcuMS4xNjk0NTQ5NzQ4LjAuMC4w

--- bill

Hello Bill,
I am completly lost. I miss a simple example on how to use the hd44780 library. The real basic example.
I am creating a time reference clock for horologist, based on satelite GPS atomic clock that you can receive all over the world. I use the LCD to display time and date and want to turn it off when not needed.
Thanks for your elp and support,

Jacques Bouchard
La difficulté du business n'exclut pas la bonne humeur

GPS: N49 22 04.8 E0 05 02.1

Dom. +33 (0)2 14 09 61 14 GSM: +33 (0)6 87 75 74 55

| bperrybap
September 12 |

  • | - |

I assume you were replying back to me.
I wasn't suggesting an extended tool.
You had asked:

How can I save energy when I do not look at my LCD display?

So I was suggesting a way to save the most power.
I was suggesting using a different lcd library to pick up some new API capabilities to and have the ability to save a bit more power beyond turning off the backlight.

In terms of API, the hd44780 library has the same API functions as LiquidCrystal_I2C since both are based on LCD API 1.0
However hd44780 has additional features as it is a more complete LCD API 1.0 implementation.
hd44780 also has documentation.

The hd44780 library is also actively maintained (LiquidCrystal_I2C is no longer maintained) and the hd44780 library is quite a bit faster and has some additional capabilties like status codes and the ability to do automatic line wrapping.

In terms of simpler, using what I was suggesting is no more complex.
What I was suggesting was that if you used the hd44780 library, you not only would have not only have access to backlight() and noBacklight() API functions but also would have on() and off() API functions which could save you a little bit more more power.

i.e.
lcd.off() and lcd.on()
where off() (as noted in the hd44780 and LCD API 1.0 documentation) turns off the pixels (display) and the backlight
and on() turns them both on.
Turning off the display puts the hd44780 chip into a lower power state.

Here is a link to information about LCD API 1.0
https://playground.arduino.cc/Code/LCDAPI/?_gl=11e8bgkm_gaMjA4MjcyMDA2NS4xNjYxOTczMzMx_ga_NEXN8H46L5*MTY5NDU0ODcxOC44OTcuMS4xNjk0NTQ5NzQ4LjAuMC4w

--- bill

Did you read through the documentation?
Specifically the hd44780 library wiki and the hd44780_I2Cexp wiki?

In terms of how to use the library. The library is fully LiquidCrystal API and LCD API 1.0 compatible, so existing code will work with just a few minor changes. The changes are usually just header file and the lcd object declaration.
I.e. typically there are no changes needed to the actual main sketch code.
All this is in the documentation.

The hd44780 library is a bit different from most other Arduino libraries in that it has multiple i/o classes for different h/w.
There is an i/o class for each h/w interface to the LCD.
Each i/o class has its own examples and wiki page.
Each i/o class includes several examples demonstrating how to use it, including a minimal HelloWorld example.
The main hd44780 library wiki gives an overview about this.
The i/o class for your h/w is hd44780_I2Cexp.
The wiki for this i/o class describes the i/o class and explains where to locate the examples in the IDE GUI.
It has a link to the HelloWorld source code on github, but I recommend using the example in the IDE that comes with the library as it is right there with a few clicks in the IDE.
The hd44780_I2Cexp wiki also has a section " Conversion from Other libraries"
that shows the minimal modifications needed to port your existing code form other libraries such as LiquidCrystal_I2C to the hd44780 library hd44780_I2Cexp i/o class.
It is only about 4 lines of code related to header files and lcd object creation.
The existing main line code for another library will require no modifications.
I would recommend using the auto location capability so you don't have to enter in the i2c address and the library will automatically find the LCD device, which allows you to change it and not have to ever re-compile the code for a new i2c address.

I highly recommend reading the documentation at least the hd44780 library wiki home page and the hd44780_I2Cexp i/o class page.

The hd44780 library is different from most other Arduino libraries, so it will usually require a small amount of up front reading to grasp its layout.
It isn't difficult - just a bit different due to it supporting multiple h/w interfaces which requires having layered menus in the examples to keep the i/o classes separated from each other.

The hd4480 library does have documentation and many examples, including a HelloWorld for i/o class for each h/w interface.

Don't wary, I found my way in the nice pingpong# CLASSICAL demo-sketch for the HD44780-library
By the way, I looked at all the distributed examples unsuccefully

Jacques Bouchard
La difficulté du business n'exclut pas la bonne humeur

GPS: N49 22 04.8 E0 05 02.1

Dom. +33 (0)2 14 09 61 14 GSM: +33 (0)6 87 75 74 55

| bperrybap
September 12 |

  • | - |

I assume you were replying back to me.
I wasn't suggesting an extended tool.
You had asked:

How can I save energy when I do not look at my LCD display?

So I was suggesting a way to save the most power.
I was suggesting using a different lcd library to pick up some new API capabilities to and have the ability to save a bit more power beyond turning off the backlight.

In terms of API, the hd44780 library has the same API functions as LiquidCrystal_I2C since both are based on LCD API 1.0
However hd44780 has additional features as it is a more complete LCD API 1.0 implementation.
hd44780 also has documentation.

The hd44780 library is also actively maintained (LiquidCrystal_I2C is no longer maintained) and the hd44780 library is quite a bit faster and has some additional capabilties like status codes and the ability to do automatic line wrapping.

In terms of simpler, using what I was suggesting is no more complex.
What I was suggesting was that if you used the hd44780 library, you not only would have not only have access to backlight() and noBacklight() API functions but also would have on() and off() API functions which could save you a little bit more more power.

i.e.
lcd.off() and lcd.on()
where off() (as noted in the hd44780 and LCD API 1.0 documentation) turns off the pixels (display) and the backlight
and on() turns them both on.
Turning off the display puts the hd44780 chip into a lower power state.

Here is a link to information about LCD API 1.0
https://playground.arduino.cc/Code/LCDAPI/?_gl=11e8bgkm_gaMjA4MjcyMDA2NS4xNjYxOTczMzMx_ga_NEXN8H46L5*MTY5NDU0ODcxOC44OTcuMS4xNjk0NTQ5NzQ4LjAuMC4w

--- bill

The thread you referenced is from a user that failed/refused to read the documentation and then got very frustrated and mad because of his misunderstandings.
His issues were related to a misunderstanding of how the library lays out the examples from his not reading the documentation.
I tried to coach him through things but he still refused to listen and got even more upset.

Again, I would encourage reading the hd44780 library documentation. It describes the library layout and where the examples are, and even gives very specific detailed instructions for what to click on in the GUI to get to the examples.

For example, in the IDE GUI:
Here is where the examples are for the hd44780_I2Cexp i/o class:
[File]->Examples->hd44780->ioClass->hd44780_I2Cexp
There are multiple examples there including a "HelloWorld" minimal example.
So you click on [File] on the IDE top menu bar then simply follow the menus down to hd44780_I2Cexp, then select your desired example.
I.e. to get to and bring up the HelloWorld example for the hd44780_I2Cexp i/o class you would click on
[File]->Examples->hd44780->ioClass->hd44780_I2Cexp/HelloWorld

It seems pretty easy to get to examples, given the documentation literally shows the exact things to click on in the IDE to bring up examples.

Immediately after installing the library I recommend running diagnostic sketch, I2CexpDiag, as is recommend by the the hd44780_I2Cexp wiki before jumping in to any of the examples.
This will test the I2C and LCD h/w and library s/w to make sure everything is working.
You can read about it on the hd44780_I2Cexp wiki page in the "Diagnostics" section.

I truly feel for users who are not native English speakers, as they may really struggle with the English only documentation. For them it can be quite difficult and I currently don't have a solution for them.

That said, there are a fair number of native English speaking people that don't/won't read the documentation that have issues locating the examples.
They end spending WAY more time floundering around looking, guessing about things, and getting frustrated, than it would have taken to simply spend 5 minutes reading the documentation to grasp the library and example structure.
Once grasped, things are relatively easy to find.

I do have a 2.x release of the library that re-arranges the directory structure and example menus to try to make things a bit more obvious. So while there will still be i/o classes, it will be little bit more obvious where the examples are as some of the test sketch code will be hidden from the IDE GUI menus.

But in the end users must grasp that the hd44780 library consists of i/o classes and each i/o class has its own examples.
So a user must follow the IDE example menus to get to the area for the i/o class for the LCD h/w that they have.
Once that is understood, things are mostly obvious.
with the exception of the common test code in the hd44780examples area which is not really examples but test code.
THAT part is confusing, but it goes away (becomes hidden) in version 2.x of the hd44780 library.

I've drug my feet on the 2.x library release because I'd like to use some newer C++ features in the library to add some better I2C usability & portability.
It requires C++ 2017 but the Arduino.cc team has hard coded the IDE to use 2011 so these newer features are not yet available.
I have waited, but I don't seem them moving on this, so I may have to abandon this approach.
Crazy that we are restricted to using a C++ standard that is more than 10 years old.

--- bill

Quote:

For example, in the IDE GUI:
Here is where the examples are for the hd44780_I2Cexp i/o class:
[File]->Examples->hd44780->ioClass->hd44780_I2Cexp
There are multiple examples there including a "HelloWorld" minimal example.
So you click on [File] on the IDE top menu bar then simply follow the menus down to hd44780_I2Cexp, then select your desired example.
I.e. to get to and bring up the HelloWorld example for the hd44780_I2Cexp i/o class you would click on
[File]->Examples->hd44780->ioClass->hd44780_I2Cexp/HelloWorld
unquote

That is what I missed to get to the many examples.
Other access to examples on github are not easy to understand.
Soemtimes the experts have to go down into the arena to help to solve simple problems.

| bperrybap
September 14 |

  • | - |

JLBCS:

By the way, I looked at all the distributed examples unsuccefully

The thread you referenced is from a user that failed/refused to read the documentation and then got very frustrated and mad because of his misunderstandings.
His issues were related to a misunderstanding of how the library lays out the examples from his not reading the documentation.
I tried to coach him through things but he still refused to listen and got even more upset.

Again, I would encourage reading the hd44780 library documentation. It describes the library layout and where the examples are, and even gives very specific detailed instructions for what to click on in the GUI to get to the examples.

For example, in the IDE GUI:
Here is where the examples are for the hd44780_I2Cexp i/o class:
[File]->Examples->hd44780->ioClass->hd44780_I2Cexp
There are multiple examples there including a "HelloWorld" minimal example.
So you click on [File] on the IDE top menu bar then simply follow the menus down to hd44780_I2Cexp, then select your desired example.
I.e. to get to and bring up the HelloWorld example for the hd44780_I2Cexp i/o class you would click on
[File]->Examples->hd44780->ioClass->hd44780_I2Cexp/HelloWorld

It seems pretty easy to get to examples, given the documentation literally shows the exact things to click on in the IDE to bring up examples.

Immediately after installing the library I recommend running diagnostic sketch, I2CexpDiag, as is recommend by the the hd44780_I2Cexp wiki before jumping in to any of the examples.
This will test the I2C and LCD h/w and library s/w to make sure everything is working.
You can read about it on the hd44780_I2Cexp wiki page in the "Diagnostics" section.

I truly feel for users who are not native English speakers, as they may really struggle with the English only documentation. For them it can be quite difficult and I currently don't have a solution for them.

That said, there are a fair number of native English speaking people that don't/won't read the documentation that have issues locating the examples.
They end spending WAY more time floundering around looking, guessing about things, and getting frustrated, than it would have taken to simply spend 5 minutes reading the documentation to grasp the library and example structure.
Once grasped, things are relatively easy to find.

I do have a 2.x release of the library that re-arranges the directory structure and example menus to try to make things a bit more obvious. So while there will still be i/o classes, it will be little bit more obvious where the examples are as some of the test sketch code will be hidden from the IDE GUI menus.

But in the end users must grasp that the hd44780 library consists of i/o classes and each i/o class has its own examples.
So a user must follow the IDE example menus to get to the area for the i/o class for the LCD h/w that they have.
Once that is understood, things are mostly obvious.
with the exception of the common test code in the hd44780examples area which is not really examples but test code.
THAT part is confusing, but it goes away (becomes hidden) in version 2.x of the hd44780 library.

I've drug my feet on the 2.x library release because I'd like to use some newer C++ features in the library to add some better I2C usability & portability.
It requires C++ 2017 but the Arduino.cc team has hard coded the IDE to use 2011 so these newer features are not yet available.
I have waited, but I don't seem them moving on this, so I may have to abandon this approach.
Crazy that we are restricted to using a C++ standard that is more than 10 years old.

--- bill

I made some modifications to the hd44780_I2Cexp wiki page, to try to further clarify where to find the examples in the IDE GUI.

--- bill

@JLBCS

May I suggest that you remove your phone numbers and other personal information from your posts. I understand that you seem to be using email to post and that is probably the reason why it's happening.

But you're soliciting spam !!

Thank you for pointing that misstake. I removed the closing of my mail so it clears the problem.

Thank you.
Very promising approach for LCDs.
How can we use this methodology when creating a .csv file for feeding a spreadsheet ?

May I suggest that some examples show and make good use of the streaming.h capabilities ?

See attached PDF document LCD and streaming
LCD_and_streaming.pdf (2.1 MB)

This is what I came to: [quote="JLBCS, post:6, topic:1174344"]
LCD_and_streaming.pdf (2.1 MB)
[/quote]