B4R Question PCF8574 library and ESP32

Mostez

Well-Known Member
Licensed User
Longtime User
I tried to run this PCF8574 example on ESP32S board but failed to compile the code, is it possible to use this library with ESP32? if yes, kindly provide simple example code.

I tried different initialization,

B4X:
pcf.Initialize(0x20,pcf.I2C_Wire2) 'also tried Wire and Wire1
pcf.begin(21,22,0xFF) 'ESP I2C pins

TIA
 
normally on esp32 wire0 is the first and wire1 is the second.

for first wire on esp32:
pfc.Initialize(0x20,pcf.I2C_Wire0);
pfc.begin1(0xFF)

and SDA by default is GPIO 21 / SCL by default is GPIO 22
 
Upvote 0
I2C_Wire0 is not exist, however I tried (begin1) method with no hope, I changed to Arduino Nano but it failed too!
 
Upvote 0
just tested with esp8266 and compilation is OK
i will check soon with esp32

B4R 3.90
Arduino 1.8.15
 
Upvote 0
compiled OK, and the led blinked OK too. did not test the keys relevant code yet.
Thank you for your great efforts.
 
Upvote 0
Back
Top