Lib for Serial 16x2 LCD (based on HD44780U controller)

Hi!

Here is a library to control a 16x2 serial LCD board, with maybe a little bit higher level API for ease of use.

// Sample of code:

void loop()
    {
      String myString = "Hello World";
      
      myLcd.Clear();                       // clear the display
      myLcd.SetBrightness(80);             // set the brightness to 80%
      myLcd.SetDisplay(true, true, false); // enable display and cursor underline but not cursor blink
      myLcd.Print(1,3,myString);           // print a string @ line 1, offset 3
      delay(1000);
      ...
    }

The library can be found on my Github repository (GitHub - alinagithub/LibSerLcdArduino: Util lib for 16x2 Serial LCD).

The documentation can be found on the Github wiki page (Home · alinagithub/LibSerLcdArduino Wiki · GitHub).

Some other related information:

Enjoy.
AL

A little pict of a 16x2 Serial LCD!

Added! A test using serial 16x2 LCD display and a MX90614 thermal sensor!

#include <Wire.h>
#include <SoftwareSerial.h>

#include <Adafruit_MLX90614.h> // see https://github.com/adafruit/Adafruit-MLX90614-Library    
#include <libserlcdarduino.h>  // see https://github.com/alinagithub/LibSerLcdArduino

SerLcd16x2Arduino LCD(7);
Adafruit_MLX90614 mlx  = Adafruit_MLX90614();

void setup()
{
  Serial.begin(9600);
  mlx.begin();
  
  LCD.Clear();
  LCD.SetBrightness(80);
  LCD.SetDisplay(true, false, false);
  LCD.Print(1,1,"Global:",7);
  LCD.Print(2,1,"Local:",6);
}


void loop() 
{
  String Measure;
  
  Measure = "";
  Measure += mlx.readAmbientTempC();
  LCD.Print(1,9,Measure);
  LCD.Print(1,14,"_C ",3);
  
  Measure = "";
  Measure += mlx.readObjectTempC();
  LCD.Print(2,9,Measure);  
  LCD.Print(2,14,"_C ",3); 
}

:smiley:

Improved version on GitHub: speed optimization (strings are displayed faster if it fits within the line)