Dear friends,
i'm working with pcf8574a , but i'm not be able to run properly this device.....i have 4 pcf8574 as input and i want to test the input when a button is pressed....
ok i give my example program...but this does.t work.....can you help me please??
i'm using also a picaxe18m2......Thanks a lot in advance Lestroso.
i'm working with pcf8574a , but i'm not be able to run properly this device.....i have 4 pcf8574 as input and i want to test the input when a button is pressed....
ok i give my example program...but this does.t work.....can you help me please??
i'm using also a picaxe18m2......Thanks a lot in advance Lestroso.
Code:
#picaxe 18m2
setfreq m16
;
i2cslave %01111000, i2cslow, i2cbyte
pause 1000
writei2c (%11111111)
i2cslave %011110010, i2cslow, i2cbyte
pause 1000
writei2c (%11111111)
i2cslave %01111100, i2cslow, i2cbyte
pause 1000
writei2c (%11111111)
i2cslave %01111110, i2cslow, i2cbyte
pause 1000
writei2c (%11111111)
start:
;read from first chip pcf8574...if a button is pressed then go to uno
pause 1000
readi2c %01111001,(b0)
IF pin0=0 THEN uno
;PAUSE 500
GOTO start
uno:
;make a music
tune c.1,12,(7,9,5,37,192)
GOTO start
Last edited by a moderator: