Go Down

Topic: I2C issue on Arduino Nano (Read 1 time) previous topic - next topic


Apr 22, 2013, 11:16 am Last Edit: Apr 22, 2013, 11:36 am by junkai Reason: 1

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 :smiley-red:

Code: [Select]
#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.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131