You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when i bridge pins P0 and P1 together with this code it reads 0 untill i connect P1 to vcc. also this behavior seems to make push button rotary encoders not work.
PortExpander_I2C library works better in this regard if you want to use as reference.
i think its better to have the pins high then goto ground to read states
When the code executes pcf8574.digitalWrite(P0, HIGH), its actually configuring P0 as input (a PCF8574 pin cannot be configured as output with high value); so in your loop() function you have both P0 and P1 configured as inputs, and if these pins are only connected to each other and not connected to anything else, the input value you read from P1 (and also from P0 for that matter) could be either high or low (PCF8574 pins configured as inputs don't have internal pull-up or pull-down resistors). So if you expect to read 1 from P1, you should connect an external pull-up resistor to this pin.
when i bridge pins P0 and P1 together with this code it reads 0 untill i connect P1 to vcc. also this behavior seems to make push button rotary encoders not work.
PortExpander_I2C library works better in this regard if you want to use as reference.
i think its better to have the pins high then goto ground to read states
The text was updated successfully, but these errors were encountered: