there's maybe many reason why it doesn't work
i2cread sda,scl,dev_addr,reg_addr,[var]
1. what are your definition of these var (SDA,SCL,DEV_ADDR,REGADDR,VAR) ?
Is at least dev_addr is a byte loaded with %1001000
are SDA,SCL pin are pull-up with 4.7 K resistors?
wich device (PIC) are you using ?
There's maybe some register you need to set before the device work properly too. The best solution...again, datasheet. I know it's pain in the neck as solution but there's no other way exept if somebody here has already work with those sensor and have some code to share...
Have you some I2C based EEPROM (24c01, 24c02... ) to test with before the temperature sensor??? This could be handy to know how to work with simple I2C device before using *a bit* more complicated ones.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks