I’m using a cam and wifi on this board, and also i need 7 pins to run other elements (3 buttons, 2 i2c(SDA SLC) for a 64×128 oled display, 1 pin to control POWER LED converter and 1 pin to control transistor controling a small motor). Because of my need of usage a cam and wifi i only left with two ports, 32 and 33, because CAM is disabling all cam ports and wifi is disabling all ACD2 ports. And one of sollutions i found is i2c expander like PCF8574, I managed to emulate i2c on 32 and 33 ports to turn on an display so i thought it would work with expander that way. I bought PCF8574 and i connected it with esp32
esp32 -> pcf8574
vcc -> vcc
GND->GND
32 -> SCL
33-> SDA
I tried to programm a simple code to test a button state read, but it doesn’t work
#include <Wire.h>
#include “PCF8574.h”
// Instantiate Wire for generic use at 400kHz
TwoWire I2Cone = TwoWire(0);
// Instantiate Wire for generic use at 100kHz
TwoWire I2Ctwo = TwoWire(1);
void loop() {
// put your main code here, to run repeatedly:
int buttonState = pcf8574.digitalRead(P2);
Serial.println(buttonState);
}
I connecter the bottom with P2 port and it doesn’t work. I don’t know if my esp32 is connecting to this expander or not.
Also another important question, can I emulate a SDA and SCL ports for my display on PCF8574 ports(P0-P7), or i can use other SDA SCL ports on other side of the PCF8574 board? If not then only solluction i have is to use 2 esp32 for this project.
Maintaining a repository (or site or forum) is a lot like tending to a garden - it requires constant care and attention to keep it thriving. If you're a skilled gardener (or coder!) and want to help keep our repository blooming, we'd love to have you on board! We're also looking for talented writers and forum moderators to help us grow our community. Interested in joining our team? Don't hesitate to reach out and let us know how you can contribute!
Are you a fan of electronics or programming? Share your knowledge with others, write a simple tutorial or how to make a great project Contact me: share_your_ideas@mischianti.org
The content displayed on this website is protected under a CC BY-NC-ND license. Visitors are prohibited from using, redistributing, or altering any content from this website for commercial purposes, including generating revenue through advertising. Any unauthorized use is a violation of the license terms and legal action may be taken against individuals or entities found to be in violation.
You must also provide the link to the source.