LCD 1602 with PCF8574 I2C adapter driver for Android Things
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
assets
driver-lcd-pcf8574
gradle/wrapper
sample
.android-things-driver.json
.gitignore
CHANGELOG.md
LICENSE
README.md
build.gradle
gradlew
gradlew.bat
settings.gradle

README.md

LCDs with PCF8574 I2C adapter driver for Android Things

A port of the LiquidCrystal_PCF8574 Arduino library for Android Things.

Photo

Here using an LCD1602 with a LCM1602 I2C module

photo

photo2

Download

dependencies {
    compile 'com.nilhcem.androidthings:driver-lcd-pcf8574:0.0.3'
}

Usage

LcdPcf8574 lcd = new LcdPcf8574(I2C_NAME, I2C_ADDRESS); // e.g. new LcdPcf8574("I2C1", 0x3f);
lcd.begin(16, 2);
lcd.setBacklight(true);

// load custom character to the LCD
int[] heart = {0b00000, 0b01010, 0b11111, 0b11111, 0b11111, 0b01110, 0b00100, 0b00000};
lcd.createChar(0, heart);

lcd.clear();
lcd.print("Hello,");
lcd.setCursor(0, 1);
lcd.print("Android Things!");
lcd.write(0); // write :heart: custom character

// Later on
lcd.close();

Schematic

schema