Dieser Code sollte klappen:

'Make all Pcf8574 pins high -> input
I2cstart
I2cwbyte Pcf8574write
I2cwbyte 255
I2cstop

Do
'Read Pcf8574 port
I2cstart
I2cwbyte Pcf8574read
I2crbyte Pcf8574port , Nack
I2cstop
'Determine state of Switchbit bit
If Pcf8574port.switchbit = 1 Then
Ledwait = Shortwait
Else
Ledwait = Longwait
End If

Set Portd.6
Waitms Ledwait
Reset Portd.6
Waitms Ledwait
Loop


Es sollte aber reichen wenn nur der Port der auch abgefragt werden soll
auf High gesetzt wird. switchbit 1 bedeutet den Zustand des Bit 0 des PCF Port. Man kann also als Eingang nur eine 0 abfragen.

Ich hoffe ich konnte dir damit weiterhelfen

Gruß

Neutro