A sketch work on UNO, but why does it not work on NANO?


I am trying to install ADT7420 digital temperature sensor to Arduino Nano.
I have written a sketch for Arduino UNO, it works on Arduino UNO very well.
But same sketch couldn’t work on Arduino NANO :~

Could you kindly tell me what is wrong?
Please help me :blush:

#include <I2C.h>
#define ADT 0x48

int i,ans;
long temp;       
double celsius;  

void setup()
  byte st=I2c.receive();       
  Serial.println(st, HEX);     

void loop()
  int i;
  byte xH,xL;

  xH = I2c.receive();        
  xL = I2c.receive();        
  Serial.print(": ");*/
  celsius = double(long(word(xH,xL)) * 100/128)/100.00;  

I use SCL as A5, SDA as A4.

It must work.Are you using the Pull-Up resistors in I2C lines?

Hi, HugoPT. Thanks replied to me

I have found wireling is wrong :blush:

I spent 2hours for it....hahaha

Hi Hophop I want to use UNO to read my ADT7420 sensor also. Can you share your sketch with me which you used in your arduino UNO?

Thank you so much! lucas