09-29-2016, 01:31 AM
Hi MarkHaysHarris777,
Thanks for your reply. I must have been unclear in my first post - I am getting data from the T/H sensor, therefore, I have the correct address and bus.
I was actually thinking about litte-endian vs. big-endian as the cause of my problem since I can see that the T/H sensor sends the result MSB-LSB (can't remember which of the endians that is). So you suggest that I need to switch the order of the returned bytes and the do the conversion again?
When you say that I must first write to the I2C device and then read. Do you mean that the smbus command "read_word_data(addr,cmd)" does not write the code in cmd before reading? The only documentation I found is here. I tried writing the command first (using write_byte(0x40, 0xE5)) and then issuing "read_word_data(0x40, 0xE5)" but get similar results.
I am probably missing some essential part that is right under my nose...
Thanks for your reply. I must have been unclear in my first post - I am getting data from the T/H sensor, therefore, I have the correct address and bus.

I was actually thinking about litte-endian vs. big-endian as the cause of my problem since I can see that the T/H sensor sends the result MSB-LSB (can't remember which of the endians that is). So you suggest that I need to switch the order of the returned bytes and the do the conversion again?
When you say that I must first write to the I2C device and then read. Do you mean that the smbus command "read_word_data(addr,cmd)" does not write the code in cmd before reading? The only documentation I found is here. I tried writing the command first (using write_byte(0x40, 0xE5)) and then issuing "read_word_data(0x40, 0xE5)" but get similar results.
I am probably missing some essential part that is right under my nose...
