Skip to content

cannot use two different LCD with PCF8574 in the same arduino sketch #14

Description

@albmef

Hi
if i try to initialize two LCD with differents addresses on the same bus i get a compilation error
"
LiquidCrystalI2C_RS_EN(lcd0, 0x27, false)
LiquidCrystalI2C_RS_EN(lcd1, 0x26, false)
"

looks like something in macro expansion went wrong because "macro_backlight_tc" seems to have been defined twice imho

"
In file included from /tmp/.arduinoIDE-unsaved20221019-3301-1y9wb1.lcm1wi/HelloI2c/HelloI2c.ino:27:
/home/alban/Arduino/libraries/LiquidCrystalIO/src/LiquidCrystalIO.h:397:10: error: conflicting declaration 'auto macro_backlight_tc'
397 | auto macro_backlight_tc = (backlightInv) ? LiquidCrystal::BACKLIGHT_INVERTED : LiquidCrystal::BACKLIGHT_NORMAL;
| ^~~~~~~~~~~~~~~~~~
/tmp/.arduinoIDE-unsaved20221019-3301-1y9wb1.lcm1wi/HelloI2c/HelloI2c.ino:40:1: note: in expansion of macro 'LiquidCrystalI2C_RS_EN'
40 | LiquidCrystalI2C_RS_EN(lcd1, 0x26, false)
| ^~~~~~~~~~~~~~~~~~~~~~
/home/alban/Arduino/libraries/LiquidCrystalIO/src/LiquidCrystalIO.h:397:10: note: previous declaration as 'LiquidCrystal::BackLightPinMode macro_backlight_tc'
397 | auto macro_backlight_tc = (backlightInv) ? LiquidCrystal::BACKLIGHT_INVERTED : LiquidCrystal::BACKLIGHT_NORMAL;
| ^~~~~~~~~~~~~~~~~~
/tmp/.arduinoIDE-unsaved20221019-3301-1y9wb1.lcm1wi/HelloI2c/HelloI2c.ino:39:1: note: in expansion of macro 'LiquidCrystalI2C_RS_EN'
39 | LiquidCrystalI2C_RS_EN(lcd0, 0x27, false)
| ^~~~~~~~~~~~~~~~~~~~~~

exit status 1

Compilation error: exit status 1
"

arduino IDE v2.0.2
raspberrypi pico board
LiquidCrystalIO v 1.4.3

best regards,
Alban

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions