Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By schufti
#31046 good to hear that you got it working.

In no hold mode you have to make sure that you wait the specified max. time for the measurement to be ready before you fetch the results or implement polling the status for end of conversion.

So you may go edit your initial post and append <solved> or sth similar. to the title.
User avatar
By Daemach
#31047 Done -

If you could explain the poll status for end of conversation thing that would be great - especially if it came with some example code. I'm not clear on how the no-hold handshake works right now...
User avatar
By schufti
#31053 in general it won't be necessary to implement the status polling.
if you look at the sparkfun lib for example, you see that after issuing the "read humidity" command they explicitly wait the max. conversion time given in the datasheet before they try to read the result from the sensor.
Code: Select all//Request a humidity reading
   Wire.beginTransmission(HTDU21D_ADDRESS);
   Wire.write(TRIGGER_HUMD_MEASURE_NOHOLD); //Measure humidity with no bus holding
   Wire.endTransmission();

   //Hang out while measurement is taken. 50mS max, page 4 of datasheet.
   delay(55);

   //Comes back in three bytes, data(MSB) / data(LSB) / Checksum
   Wire.requestFrom(HTDU21D_ADDRESS, 3);

this is good practice unless you have tight (unpredictable) timing where you can't afford "delay()'s".
Then you would poll the status regularily between your other tasks and read the result when conversion is ready.
User avatar
By Daemach
#31055 That makes sense and I'm not reliant on tight timing at this point.

For curiosities sake, though, how would you "poll the status"? I'm not good with i2c at all.