i ran out of pins on my arduino,so i want to use a port expander PCF8575 as suggested by another user here . i want to use input pull up can i use pinMode(0, INPUT_PULLUP); on it ? to not keep my inputs floating,i am going to be using toggle switches as inputs
Yes, you write a 1 to that channel. That engages the internal pull-up. If your switch is closed, when you read that channel back it will be 0.
That command only works on the internal pins, not on the pins for a PCF8575.
If you look at the data sheet for that device it tells you how setup inputs. It says
All ports programmed as input should be set to logic 1. To read, the master (microcontroller) first addresses the slave device after it receives the interrupt. By setting the last bit of the byte containing the slave address to logic 1 the read mode is entered. The data bytes that follow on the SDA are the values on the ports.
If the data on the input port changes faster than the master can read, this data may be lost.
@PaulRB @Grumpy_Mike thanks for the suggestions,will try to do it that way.