12-11-2024, 09:56 AM
I success read address ifof I2C 0x24, 25 0x21 0x22
This is my log:
Found address: 33 (0x21)
Found address: 34 (0x22)
Found address: 36 (0x24)
Found address: 37 (0x25)
but when try to do
pcf8574.begin() -> it is failed? waht can be the problem?
My code :
// Set i2c address
PCF8574 pcf8574_1(0x24,4,5);
PCF8574 pcf8574_2(0x25,4,5);
if (pcf8574_1.begin())
{
Serial.println("PCF8574_1_OK");
}
else
{
Serial.println("PCF8574_1_KO");
}
Serial.print("Init pcf8574_2...");
if (pcf8574_2.begin()){
Serial.println("PCF8574_2_OK");
}else{
Serial.println("PCF8574_2_KO");
}
What cvan be the problem?
PCF8574 pcf8574_1(0x24);PCF8574 pcf8574_1(0x24);Serial.print("Init pcf8574_2...");
if (pcf8574_2.begin()){
Serial.println("PCF8574_2_OK");
rfrrr }else{
w
Serial.println("PCF8574_2_KO");
}
if (pcf8574_1.begin())
{
Serial.println("PCF8574_1_OK");
}
else
{
Serial.println("PCF8574_1_KO");
}
PCF8574 pcf8574_2(0x25);
PCF8574 pcf8574_2(0x25);PCF8574 pcf8574_1(0x24);
PCF8574 pcf8574_2(0x25);
pcf8574_1.begin() pcf8574_1.begin()pcf8574_1.begin()pcf8574_1.begin()
This is my log:
Found address: 33 (0x21)
Found address: 34 (0x22)
Found address: 36 (0x24)
Found address: 37 (0x25)
but when try to do
pcf8574.begin() -> it is failed? waht can be the problem?
My code :
// Set i2c address
PCF8574 pcf8574_1(0x24,4,5);
PCF8574 pcf8574_2(0x25,4,5);
if (pcf8574_1.begin())
{
Serial.println("PCF8574_1_OK");
}
else
{
Serial.println("PCF8574_1_KO");
}
Serial.print("Init pcf8574_2...");
if (pcf8574_2.begin()){
Serial.println("PCF8574_2_OK");
}else{
Serial.println("PCF8574_2_KO");
}
What cvan be the problem?
PCF8574 pcf8574_1(0x24);PCF8574 pcf8574_1(0x24);Serial.print("Init pcf8574_2...");
if (pcf8574_2.begin()){
Serial.println("PCF8574_2_OK");
rfrrr }else{
w
Serial.println("PCF8574_2_KO");
}
if (pcf8574_1.begin())
{
Serial.println("PCF8574_1_OK");
}
else
{
Serial.println("PCF8574_1_KO");
}
PCF8574 pcf8574_2(0x25);
PCF8574 pcf8574_2(0x25);PCF8574 pcf8574_1(0x24);
PCF8574 pcf8574_2(0x25);
pcf8574_1.begin() pcf8574_1.begin()pcf8574_1.begin()pcf8574_1.begin()