PCF8574 Pullup resistance

Hello

I'm using and old multi purpose module with LCD, buzzer, key switch. The board is using 3 PCF8574 i2C IC
I could use the LCD, the problem is reading the key switch. The pins are always to a LOW level even when I set the pin to use the internal pullup.

void setup()
{
Serial.begin(9600);

// Set pinMode to OUTPUT
pcf8574.pinMode(P7, INPUT_PULLUP);

If I set the pin as an output and write a "HIGH" to it, I will get a HIGH level. The pin will always be at a LOW level when I set it to be an input. The board is a module and should be usable without modification to it by adding real pullup resistance.

Any idea on how to resolve the problem?

Martin

By reading some post, I see the the PCF8574 need to be first write to a HIGH level then read back to be able to read the input.

I saw a post about using readButton function, but don't know how to use it.

Will create a new post for it.

Martin

arjfca's new thread:

The PCF8574 is not a port and does not behave like one. I do not understand how you set the pin to use the internal pull up. You can read the port set the pins high or low, that is it. When you read a pins as an input you set the appropriate pins high, and the external device will either drive them low or high, you read it, that is all it will do unless you get involved with the interrupt pin. The Pseudo input function is easy once you get the hang of it. This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil