$regfile = "m48def.dat"
$crystal = 4000000

Config Portd.2 = Input
Config Portd.3 = Input
Config Portd.4 = Input
Config Portd.5 = Input
Config Portd.6 = Input
Config Portd.7 = Input
Config Portb.0 = Input
Config Portb.1 = Input
 
Config Sda = Portb.1
Config Scl = Portb.2

Config I2cdelay = 10
Const Pcf8574wert = &H73                                    
                                                        
Dim Wert As Byte

I2cinit
'************************************************************************
Do

If Pind.2 = 0 Then Wert.0 = 1
If Pind.3 = 0 Then Wert.1 = 1
If Pind.4 = 0 Then Wert.2 = 1
If Pind.5 = 0 Then Wert.3 = 1
If Pind.6 = 0 Then Wert.4 = 1
If Pind.7 = 0 Then Wert.5 = 1
If Pinb.0 = 0 Then Wert.6 = 1
If Pinb.1 = 0 Then Wert.7 = 1

I2cstart
I2csend Pcf8574wert                                         
I2cwbyte wert                                      
I2cstop
Loop

End