I2C eprom help

Status
Not open for further replies.

vlelectroniclab

Active member
hi, I use a teensy 3.2 with an eprom i2c M24256, but I can't write an integer, I get up to the byte (256). is there any library that lets me write and read an integer? did anyone do that? can you send me a working piece of code?
thank you all.
 
Just write the integer as four bytes?
pseudocode:
Code:
write(myInteger & 0xff);
write((myInteger >> 8) & 0xff);
write((myInteger >> 16) & 0xff);
write((myInteger >> 24) & 0xff);
 
Status
Not open for further replies.
Back
Top