Disha Karnataki
Full Member level 5
- Joined
- Jul 20, 2013
- Messages
- 249
- Helped
- 9
- Reputation
- 18
- Reaction score
- 8
- Trophy points
- 18
- Location
- india
- Activity points
- 2,231
i have interfaced a mpu 6050 to my atmega 8 & have written a code using i2c header file.
the code is to see whether the device is accessible or not. and the function used is:
Issues a start condition and sends address and transfer direction.
return 0 = device accessible, 1= failed to access device
then i am printing the value got on lcd
ex:
so ret should either print 0 or 1.
but lcd remains blank (there is no print at all).
i have tested the lcd (it's working all fine with other programs).
I am unable to figure out what is the exact problem..:-(
the code is to see whether the device is accessible or not. and the function used is:
Code:
unsigned char i2c_start(unsigned char address)
return 0 = device accessible, 1= failed to access device
then i am printing the value got on lcd
ex:
Code:
#define Dev24C02 0X68 //sensor address
ret=i2c_start(Dev24C02); //sending device address
lcd_showvalue(ret);
so ret should either print 0 or 1.
but lcd remains blank (there is no print at all).
i have tested the lcd (it's working all fine with other programs).
I am unable to figure out what is the exact problem..:-(
Last edited: