Giter Site home page Giter Site logo

lcd_1602_i2c's Introduction

I2C Character LCD Driver

Screen

Provides an embedded Rust driver for common 16x2 LCD displays that use the AiP31068L chip to drive the display, and a PCA9633 chip to drive the RGB backlight.

This has been tested with the Waveshare LCD1602 module. It may also work with other RGB displays like the Groove 16X2 LDC RGB, but I haven't tested it.

This is a basic implementation, and doesn't currently support custom characters.

Speed

This driver is fast enough that there are no noticable delays when updating text on the screen. In my programs, I'm using spaces to clear the ends of lines rather than clearing the screen.

Example

Currently there is a single, but working, example of using this crate in the examples/STM32F10x folder. The example is using an STM32F103RB Nucleo-64 board. This is a nice little board as it has the programmer/debugger built into the board.

let scl = gpiob.pb10.into_alternate_open_drain(&mut gpiob.crh);
let sda = gpiob.pb11.into_alternate_open_drain(&mut gpiob.crh);

let i2c_bus = BlockingI2c::i2c2(
    peripherals.I2C2,
    (scl, sda),
    i2c::Mode::Standard {
        frequency: 400_000.hz(),
    },
    clocks,
    &mut rcc.apb1,
    1000,
    10,
    1000,
    1000,
);

let mut lcd = Lcd::new(i2c_bus, LCD_ADDRESS, RGB_ADDRESS, &mut delay).unwrap();
lcd.set_rgb(255, 255, 255).unwrap();
lcd.print("Hello world!").unwrap();

License

This project is licensed under MIT license (LICENSE or https://opensource.org/licenses/MIT)

lcd_1602_i2c's People

Contributors

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