I have posted an LCD Library that can drive multiple PCF8474-based I2C LCDs from a single PICAXE chip.

Flenser

Senior Member
I have uploaded another port of the Arduino liquidcrystal LCD library to the PICAXE chips, this time a version can drive multiple character LCDs using the PCF8574-based I2C backpack from a single PICAXE chip: http://LCD LIbrary LCD_LIB-PCF8574-I2C-Multi

While working on the original LIbrary to drive one PCF8574-based LCD it occurred to me that, as these are I2C devices, a library which could drive multiple LCD displays might be useful.

Here is all the code needed to configure thiis PCF8574-based I2C Multi LCD library and initialize two LCDs, taken from my PICAXE version of the "Hello World" example program:

; Include the LCD_LIB configuration macro
#INCLUDE "LCD_LIB-PCF8574-I2C-Multi-Config-Macro.basinc"

; Configure the LCD_LIB library settings
; LCD_LIB(i2cMode, wTempVar, bTempVar1, bTempVar2)
LCD_LIB(I2CSLOW_8, w4, b3, b5)

; Include the LCD_LIB library code
#INCLUDE "LCD_LIB-PCF8574-I2C-Multi.basinc"

setup:
; Initialize the 1st LCD
; LCD_begin(lcdName, columns, rows, slaveAddress, bPrivVar)
LCD_begin(LCD1, 16, 2, $4C, b7)

; Initialize the 2nd LCD
; LCD_begin(lcdName, columns, rows, slaveAddress, bPrivVar)
LCD_begin(LCD2, 16, 2, $4E, b6)

It turned out that using this multi-PCF8474 LCD library the code to drive one LCD is not much larger that the original library:
The code to configure the library and intialize one LCD using the original LCD LIB-PCF8574-I2C library: 306 bytes
The code to configure the library and intialize one LCD using this LCD_LIB-PCF8574-I2C-Multi library: 334 bytes
The code to configure the library and intialize two LCDs using this LCD_LIB-PCF8574-I2C-Multi library: 368 bytes


All bug reports for this library are welcome.
 
Last edited:
Sounds great Flenser! No time to try now but will someday.

BTW I get a dead link on your lcd library link.
 
Back
Top