Skip to content

Receive error occurs at I2C port #1998

@Schrscat

Description

@Schrscat

We are using the ESP32 to receive the information from the MAX 30100. The returned value on the oscilloscope is right, which means that the value returned by the sensor is right. The value is 0x11. But received value from the esp32, showing on the PC, is not 0x11 but 0. Following is the shortest code to generate this error. This error could be a generous one. We have tried all the I2C ports, but this problem remains the same.

uint16_t readRegister(uint8_t address)
{
    Wire.beginTransmission(MAX30100_I2C_ADDRESS);
    Wire.write(address);
    Wire.endTransmission(false);
    Serial.print("byte count: ");
    Serial.println(Wire.requestFrom(MAX30100_I2C_ADDRESS, 1));

    return Wire.read();
}

void setup(){
    Serial.begin(115200);

    delay(1000);

    Wire.begin(21,22);
    Wire.setClock(I2C_BUS_SPEED);

    Serial.println(readRegister(0xff));
}

void loop(){}

The picture on the oscilloscope is

qq 20181024220001

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: StaleIssue is stale stage (outdated/stuck)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions