Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changes for example code for AT24C512_Demo #102

Open
shirish47 opened this issue Mar 22, 2017 · 0 comments
Open

changes for example code for AT24C512_Demo #102

shirish47 opened this issue Mar 22, 2017 · 0 comments

Comments

@shirish47
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant