Code:
SCL var PORTC.3 ' Clock pin pull up 4.7K
SDA var PORTC.4 ' Data pin pull up 4.7K
Cont = %01001000 'address of PCF8574 bits: A0=0 A1=0 A2=1
start:
for v = 0 to 255
toggle LEDRED
I2CWRITE SDA,SCL,Cont,[%11111111]
PAUSE 500
I2CWRITE SDA,SCL,Cont,[%00000000]
PAUSE 500
hserout ["v=", dec v, 13,10]
next v
toggle LEDGRE
goto start
End
Primer sa neta koji je Google izbacio za 0.6s...
Guglaj I2C PicBasic i imas gomilu primera... da li je ovaj displ. ili bilo sta sto je i2c - stvar je ista... samo posle pazis na wiring...
http://melabs.com/samples/PBP-mixed/i2c.htm
There are only 10 types of people in the world:
those who understand binary, and those who don't.