pwr-hd44780 0.0.5

A driver for the HD44780 LCD. Has support for both I2C and GPIO buses + implements a high-speed buffered version.
Documentation

pwr-hd44780

Version

Documentation

A Rust crate allowing to communicate with the HD44780 LCDs.

What interfaces are supported?

  • 4-bit GPIO bus (thanks to the rppal library),
  • I2C bus (thanks to the rust-i2cdev library).

Would you mind showing me some code?

Sure, pal:

extern crate pwr_hd44780;

use pwr_hd44780::Hd44780;

fn main() {
    // create the interface instance;
    // use device at address 0x27 on the first i2c bus
    let mut lcd_interface = pwr_hd44780::interface::I2C::new(
        "/dev/i2c-1", 0x27
    );

    // create the LCD's frontend;
    // use interface created before and assume LCD's width x height = 20 x 4
    let mut lcd = pwr_hd44780::frontend::Direct::new(
        &mut lcd_interface,
        20, 4
    );

    // finally - print our text
    lcd.clear();
    lcd.print("Hello World! :-)");
}

For more examples, take a dive into the examples directory.

License

Copyright (c) 2018, Patryk Wychowaniec <wychowaniec.patryk@gmail.com>.
Licensed under the MIT license.