Introduction

Preview your LCD characters before uploading them to a micro-controller as if scrollDisplayLeft and scrollDisplayRight functions are executed.


Tags



Share

LCD Character Tester for Micro-controllers in LiquidCrystal Library

Advertisement:


read_later

Read Later



read_later

Read Later

Introduction

Preview your LCD characters before uploading them to a micro-controller as if scrollDisplayLeft and scrollDisplayRight functions are executed.


Tags



Share





Advertisement

Advertisement




Description

While I was working on a project which includes LCD displaying, I created a specific character by using createChar() function with bytes. And, I have always thought a way to preview these characters before uploading the source code of my project to the micro-controller so I created this tool to display characters reacting scrollDisplayLeft() and scrollDisplayRight() functions embedding in the default LiquidCrystal library in Arduino IDE.

Just take the following steps to utilize this tool in your next project. I hope that it will help you to create LCD characters without any effort :)

tool-img
Figure - 30.1

How it works

Step 1) Create your LCD character by using the creator interface below.

Step 2) While clicking the buttons to generate your character, it appears on the character tester in 16 to 2 format.

Step 3) Click the scrollDisplayRight and scrollDisplayLeft button to preview your character as though scrollDisplayLeft and scrollDisplayRight functions are executed by a micro-controller such as Arduino Uno on Arduino IDE.

Enter Character :









Videos

LCD Character Tester for Micro-controllers in LiquidCrystal Library | Demonstration


Source Code

You can run this code on Arduino IDE with a compatible device.

Source Code

Download



#include <LiquidCrystal.h>

const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

byte smiley[8] = {
  B00000,
  B10001,
  B00000,
  B00000,
  B10001,
  B01110,
  B00000,
};

void setup() {
  lcd.createChar(0, smiley);
  lcd.begin(16, 2);
  lcd.setCursor(0,0);  
  lcd.write(byte(0));
}

void loop() {
  // scroll 15 positions (string length) to the left
  // to move it offscreen left:
  for (int positionCounter = 0; positionCounter < 15; positionCounter++) {
    // scroll one position left:
    lcd.scrollDisplayLeft();
    // wait a bit:
    delay(150);
  }

  // scroll 15 positions (string length + display length) to the right
  // to move it offscreen right:
  for (int positionCounter = 0; positionCounter < 15; positionCounter++) {
    // scroll one position right:
    lcd.scrollDisplayRight();
    // wait a bit:
    delay(150);
  }

  // delay at the end of the full loop:
  delay(1000);
  
 }


Schematics

tool-img
Schematic - 1.1