Just notice the address missing on the Read function.
Moved the Fail label after Write to test this part first. This will let you know if the Write address was recognized so the Pause 10 is not needed.
Code:
Main:
High Led : Pause 500: Low Led : PAUSE 500
Addr=$36
I2CWRITE SDA,SCL,ADDR,LOC, Fail ' Test here first
Addr=$37 ': pause 10 ' OR If SDA=1 then main
I2CREAD SDA,SCL,ADDR,loc,[VALUE] ',Fail
PAUSE 25
DEBUG HEX Value,13,10
PAUSE 250
DEBUG "Done....",13,10
WHILE 1 : WEND
Goto Main
Fail:
toggle portc.2
goto main
Bookmarks