Skip to content

changes for example code for AT24C512_Demo #102

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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