Skip to content

No need to wait after Wire.requestFrom() and it should not be followed by Wire.endTransmission(). #1

@Koepel

Description

@Koepel

You may remove the while-loops and the Wire.endTransmission() after a Wire.requestFrom().
Explanation: Common-mistakes, number 1 and 2.

For example this:

  Wire.requestFrom( SI7021_ADR, 2);
  while ( Wire.available( ) < 2 )					
  {;;}
  
  rawData = ( Wire.read() << 8 );					
  rawData |= Wire.read( );						
  Wire.endTransmission( );	
  return rawData;

could be this:

  Wire.requestFrom( SI7021_ADR, 2);
  rawData = ( Wire.read() << 8 );					
  rawData |= Wire.read( );						
  return rawData;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions