kevincastejon / js-raspberrypi-liquid-crystal

Control i2c lcd screens with a Raspberry Pi using the i2c-bus module
MIT License
23 stars 3 forks source link

no output on Adafruit LCD #16

Closed dkossman closed 1 year ago

dkossman commented 1 year ago

Hello,

is this code compatible with the Adafruit 16x2 LCD backpack? this uses an MCP23017 decoder. I'm running on a raspberry pi Zero with Node 19.7.0. The npm install worked without errors, the code runs without error, but nothing happens on the display.

i2cdetect -y 1 finds the board at 0x20. my code:

const LCD = require('raspberrypi-liquid-crystal');
const lcd = new LCD( 1, 0x20, 16, 2 );

console.log('Starting');

try {
  lcd.beginSync();
} catch (e) {
  console.log(e);
}
console.log('beginSync');

try {
  lcd.clearSync();
} catch (e) {
  console.log(e);
}
console.log('clearSync');

try {
  lcd.printSync( 'Hello' );
} catch (e) {
  console.log(e);
}
console.log('Hello');

try {
  lcd.setCursorSync(0, 1);
} catch (e) {
  console.log(e);
}
console.log('setCursorSync');

try {
  lcd.printSync( 'World' );
} catch (e) {
  console.log(e);
}
console.log('World');

console.log('Done');

Output is:

Starting beginSync clearSync Hello setCursorSync World Done

kevincastejon commented 1 year ago

hello, this library works with PCF8574 I2C port expander, so I think it's not compatible with the hardware you mentioned, sorry