Shop OBEX P1 Docs P2 Docs Learn Events
LCD1602 I2C C Library. — Parallax Forums

LCD1602 I2C C Library.

Ported an arduino LiquidCrystal I2C library to propeller C.
Should work with other sizes, though since i only have a 1602 (16x2) display, i cant test it.

Example:
#include "simpletools.h"

#include "LCD_I2C.h"

#define SDA 29
#define SCL 28
#define ADDR 0x27

int main(){
i2c i2cbus;
LCD_I2C lcd;

i2c_open(&i2cbus, SCL, SDA, 0);

LCD_init(&lcd, &i2cbus, ADDR, 16, 2);
LCD_begin(&lcd);
LCD_backlight(&lcd);

LCD_setCursor(&lcd, 0, 0);
LCD_printstr(&lcd, "Hello, world!");

LCD_setCursor(&lcd, 0, 1);
LCD_printstr(&lcd, "Hello propeller!");
}

Datasheets:
LCD1602: https://www.openhacks.com/uploadsproductos/eone-1602a1.pdf
I2C Backpack: https://www.ti.com/lit/ds/symlink/pcf8574.pdf

Adapted from: https://github.com/lucasmaziero/LiquidCrystal_I2C

Comments

Sign In or Register to comment.