Getting Temperature/Humidity/Ambient Light data with Python
#3
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. Smile

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... Sad
  Reply


Messages In This Thread
RE: Getting Temperature/Humidity/Ambient Light data with Python - by Yomet - 09-29-2016, 01:31 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Examples of I2c in Python blanius 8 17,076 10-02-2017, 08:28 PM
Last Post: tllim
  Humidity sensor and temperature under Android dhewko 0 3,272 03-11-2017, 10:18 AM
Last Post: dhewko
  3g/4glte data connection? mightygrom 2 4,556 08-10-2016, 12:17 PM
Last Post: ipsw

Forum Jump:


Users browsing this thread: 1 Guest(s)