Skip to content

No need to clear the buffer of the Wire library. #2

@Koepel

Description

@Koepel

In the file "src/SparkFun_SHTC3.cpp" is in two places this code to clear the buffer before calling a Wire.requestFrom():

while (_wire->available())
{
  _wire->read();
}

It is not needed to clear the buffer. When the Wire.requesFrom() is called it clears the buffers and variables before starting the I2C session.
Explanation: Common-mistakes#4

This is not even a bug, but that code is not needed.

Metadata

Metadata

Assignees

No one assigned

    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