GithubHelp home page GithubHelp logo

thymonl / lcd1602_i2c Goto Github PK

View Code? Open in Web Editor NEW

This project forked from extremq/lcd1602_i2c

0.0 0.0 0.0 29 KB

A simple, I2C-based implementation of the 1602 LCD with I2C interface in C using the Raspberry Pi Pico SDK.

C 100.00%

lcd1602_i2c's Introduction

lcd1602_i2c

A simple, lightning-fast and scalable I2C-based implementation of the HD44780U 1602 LCD with I2C interface in C using the Raspberry Pi Pico SDK.

Features

  • Very efficient
    • Used the datasheet to provide minimal sleep times. On average, the display needs to sleep 160 microseconds for each command
    • Sends only the minimum amount of bytes necessary.
  • Can be used to control multiple HD44780U 1602 LCDs.
    • Just create an LCD object and use its address for each call.
    • For example lcd_char(&lcd_1, 'a'); lcd_char(&lcd_2, 'b');.
  • Heavily documented code.
    • Made sure to reference pages in the original datasheet.
    • Explained functions, variables and protocol. (Had to reverse engineer popular libraries, literally no documentation is provided for the I2C interface)

How to install the module (for beginners)

The minimal way of adding this module to your CMake project is by downloading the lcd1602_i2c.c and lcd1602_i2c.h files and placing them in the same folder as your main source.

From there, you have to add the files inside add_executable. For example:

add_executable(my_project
        main.c
        lcd1602_i2c.c
        lcd1602_i2c.h
        )

DO NOT FORGET to include hardware_i2c in your target_link_libraries.

target_link_libraries(my_project hardware_i2c pico_stdlib)

Usage

Check example.c for a complete showcase. Minimal example here:

#include "lcd1602_i2c.h"

int main() {
    /* Init my modules */
    LCD my_lcd;
    lcd_init(&my_lcd, 0x27, 4, 5, i2c0); // Check the pins on your Pico
    
    char message[] = "Thanks extremq";
    lcd_string(&my_lcd, message); 
}

lcd1602_i2c's People

Contributors

extremq 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.