Hey, this is my first time using the Arduino Mega and I have run into some problems. I am trying to use the I2C protocol to communicate with the ADT75 temperature sensor and I keep getting nothing in response from the chip. I am not sure if its a problem with the code or some hardware problem.
Here is code I have gotten so far:
#include <Wire.h>
void setup() {
Wire.begin();
Serial.begin(9600);
}
void loop()
{
Wire.beginTransmission();
Wire.write(0);
int err = Wire.endTransmission();
Serial.print("error was ");
Serial.println(err,DEC);
Wire.requestFrom(0x48,2);
byte a = Wire.read();
byte b = Wire.read();
int temperature = ((a << 8 )) | b) >> 4;
float celsius = temperature * 0.0625;
Serial.print("Temperature is ");
Serial.print(celsius);
Serial.println(" degree C ");
float fahrenheit = (temperature * 0.1125) +32;
Serial.print("Temperature is ");
Serial.print(fahrenheit);
Serial.println(" degree F ");
delay(4000);
}
It's a pretty standard code that a lot of people used and it seems to me that it should work with ADT75 as well. I think I have the address write, so I am not sure what else it could. Here is the data sheet: http://www.analog.com/static/imported-files/data_sheets/ADT75.pdf
On page 16, it shows the addresses and on page 13, it shows the register address.
Also here is the schematic I am using.
http://imgur.com/jeGmY
Any help would be appreciated. Thanks for your help.