hi,
i am working on a RTC module DS1307 with arduino uno using i2c comm protocol
the slave address mentioned in data sheet is 0x68 which is fine i can communicate with the RTC and i can read one of the register value also
#include<Wire.h>
#define ADDRS 0x68 // RTC DS1307 address
int val =0;
void setup() {
Serial.begin(9600);
Wire.begin();
}
void loop() {
Wire.beginTransmission(ADDRS); // slave address in
Wire.write(0x05); // 0x05 gives the month
Wire.endTransmission();// == 0
Wire.requestFrom(0x68, 1);
while(Wire.available())
{
val = Wire.read(); // command register
Serial.print("val:"); Serial.println(val);
}
}
but when i use the slave address different lets say 0x60 instead of actual adress 0x68
i am getting a random values
why is it happening ?
i thought slave wont respond untill and unless if we give proper address