majrashi:
One question about this code. I am using I2C to connect the two sensor and my teacher said i am didnt using and i didnt need to use the master and slave. why??
I don't know.
Probably because I don't know what was/is in your teacher's mind.
...R