It looks like you are using the CCS PICC compiler. In your #USE statement the address must be 2 x the address you wish it to be. If you want the address to be 0x40, you must enter 0x80 in the address field of the #USE like this:
Code: Select all
#use i2c(SLAVE, sda=PIN_d5, scl=PIN_d6, address = 0x80)