Skip to content

delay(100) is killing performance #14

@JM-FRANCE

Description

@JM-FRANCE

at this line there is a delay(100) whilst as noted in the spec (and the comment in code) the max time for conversion of both RH and T° is 22.8ms.

waiting 100ms seems totally overkill and using delay() prevents other tasks from running and is not optimized for reading the temperature right after reading the RH since both are generated. suggest going with

`
// When not using clock stretching (*_NOHOLD commands) delay here

// is needed to wait for the measurement.

// According to datasheet the max. conversion time is ~22.8ms at full resolution

 if (command != TEMP_PREV) delay(23); 

`

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions