Close
0%
0%

Character LCD Emulator

Emulate a HD44780 character LCD.
Includes a web wrapper to emulate it in your browser.

Similar projects worth following
785 views
I wanted to add a character LCD to my breadboard computer and web-based emulator. But first, I had to emulate one.

So, this mini project was born.

Emulates all inputs of a standard character LCD, to an internal state. The internal state can be used however you like, but the package includes a WebAssembly wrapper and Javascript front-end example.

Written in C and with no other dependencies, you could use the library with most other languages too.

A character LCD emulator you can use in any project. Including HTML5:

The Core API doesn't include any rendering functionality, so you're free to use any rendering technology to draw the resulting display. What it does provide is a description of the display's pixels. Which are lit, which are dim. Using this information, rendering a display of any size is trivial.

The repository includes one such renderer using a HTML5 canvas. 

A minimal html example:

<canvas id="lcd"></canvas>
...
var canv = document.getElementById('lcd');
var ctx = canv.getContext('2d');

vrEmuLcd.setLoadedCallback(function () {

  // create a new LCD object
  var lcd = vrEmuLcd.newLCD(16, 2, vrEmuLcd.CharacterRom.Eurpoean);
  
  // set up the display
  lcd.sendCommand(LCD_CMD_DISPLAY | LCD_CMD_DISPLAY_ON);
  
  lcd.writeString("Hello, World!");
  
  lcd.render(ctx, 0, 0, 800, 400);
});

 The display can be "skinned" with any image you choose.

Graphics Interchange Format - 285.71 kB - 09/13/2021 at 04:44

Preview
Download

View project log

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates