eng_ahmed22
Full Member level 3
Salaam All
i have a question.
i have some chars stored in EEPROM. I2C.
i want to read add. 0x00 and add. 0x01 from the I2C and merge them to obtain int.
here is my code:
/*************************************************************/
int x,int_temp;
x = (int)(I2C_READ(0x01));
x *=256;
int_temp = (int)(I2C_READ(0x00));
x = (x) | (int_temp);
/************************************************************/
i repeat this code many times to get all data from the I2C.
is that correct??
is this contains any error??
what happens is that it read some wrong data (not all)
i also tried this code:
/*************************************************************/
int x,int_temp;
x = (int)(I2C_READ(0x01));
x<<8;
int_temp = (int)(I2C_READ(0x00));
x = (x) | (int_temp);
/************************************************************/
but the same errors
plz Help
thanks alot
i have a question.
i have some chars stored in EEPROM. I2C.
i want to read add. 0x00 and add. 0x01 from the I2C and merge them to obtain int.
here is my code:
/*************************************************************/
int x,int_temp;
x = (int)(I2C_READ(0x01));
x *=256;
int_temp = (int)(I2C_READ(0x00));
x = (x) | (int_temp);
/************************************************************/
i repeat this code many times to get all data from the I2C.
is that correct??
is this contains any error??
what happens is that it read some wrong data (not all)
i also tried this code:
/*************************************************************/
int x,int_temp;
x = (int)(I2C_READ(0x01));
x<<8;
int_temp = (int)(I2C_READ(0x00));
x = (x) | (int_temp);
/************************************************************/
but the same errors
plz Help
thanks alot