Skip to content

changes for example code for AT24C512_Demo #102

@shirish47

Description

@shirish47

this code works on AT24C512, but when we provide EEPROM address more than 255 it does not work. Type casting for most significant Byte causes that problem,
Wire.beginTransmission(DEV_ADDR); Wire.write((uint8_t)addr>>8); Wire.write((uint8_t)addr); Wire.write(pbuf, len);

code below works fine.

Wire.beginTransmission(DEV_ADDR); Wire.write((uint8_t) (addr>>8) ); Wire.write((uint8_t)addr); Wire.write(pbuf, len);

putting addr>>8 in bracket.

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