Giter Site home page Giter Site logo

exlcd's Introduction

exLCD

exLCD it's extended LCD library to extend some functionality of LCD libraries the reason of creating this library it's to improve the way of showing data to lcd displays and provide a neat way of formating by including printf like functions

There's three distinctive methods inside the library

// called first inside the setup block
// used to initialize the library based on its column and row
// and the user must supply the callback function to this metho
// to be able using printf method
void begin(int col, int row, callback_func cb);

// preferable to use instead of normal print because of 
// you can specifiy which column or row unless you have to use
// setCursor and you the old buffer will be present on the display 
// which is annoying.
void print(uint8_t col, uint8_t row, const char *text);

// printf-like method which the most preferable one to me 
// and use it consistently because of flexibility and most of 
// format control work this method.
void printf(uint8_t col, uint8_t row, const char *__fmt, ...);

How to use it

Well, you need to instantiate from any LCD library you use as they all inherit from LCD class and pass the object to exLCD class and use the exLCD instead of old one because it has all same functionality that come with LCD libraries.

look at this snippet below In the code I used 16x2 I2C based LCD Display but you can use even the generic one without any problem

Note: you should write the callback function as shown without it, the library will not able to function properly and pass it to begin method as shown in setup block.

#include <LiquidCrystal_I2C.h>
#include <exLCD.hpp>

LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
exLCD<LiquidCrystal_I2C> new_lcd(&lcd);
// callback function
void lcd_write_character(char c)
{
  new_lcd.write(c);
}

void setup()
{
  // put your setup code here, to run once

  new_lcd.begin(16, 2, lcd_write_character);

  new_lcd.printf(0, 0, "exLCD");
}

void loop()
{
  // put your main code here, to run repeatedly:

}

TODO

  1. read text from the flash memory

exlcd's People

Contributors

ahmedalkabir avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.