Driver to write characters to LCD displays with a LM1602 connected via i2c like [this one] with
16x2 characters. It requires a I2C instance implementing [embedded_hal::blocking::i2c::Write
]
and a instance to delay execution with [embedded_hal::blocking::delay::DelayMs
].
Usage: ``` const LCD_ADDRESS: u8 = 0x27; // Address depends on hardware, see link below
// Create a I2C instance, needs to implement embeddedhal::blocking::i2c::Write, this // particular uses the arduinohal crate for avr microcontrollers like the arduinos. let dp = arduinohal::Peripherals::take().unwrap(); let pins = arduinohal::pins!(dp); let mut i2c = arduinohal::I2c::new( dp.TWI, // pins.a4.intopullupinput(), // use respective pins pins.a5.intopullupinput(), 50000, ); let mut delay = arduinohal::Delay::new();
let mut lcd = lcdlcm1602i2c::Lcd::new(&mut i2c, &mut delay) .address(LCDADDRESS) .cursoron(false) // no visible cursos .rows(2) // two rows .init().unwrap(); ```
This site describes how to find the address of your LCD devices.
There is a similar crate [lcd1602i2c] but that did not work with this display.