Int address2 = 73 //decimal address of sensor 2 Int address1 = 72 //decimal address of sensor 1 We use these values in our sketch as addresses for each sensor.Īrduino I2C Sketch Code /* source of code: In our case TC74A0 has binary address of 1001000, TC74A1 1001001 and TC74A2 1001010 which converts into decimal 72, 73 and 74 respectively. Video presentation of the working Arduino projectsĮvery IC that knows I2C protocol has a unique address as you can see in the table above and you must use that address when you initiate the communication from the master device to the slaves. We use the serial monitor to display the data received from the board and one interesting thing you might notice is that the data is already printed in degrees because this is a digital temperature sensor so we won’t have to do any data conversion from analog to digital. The two 4.7K pull-up resistors must be used when using I2C communication. As you can see in the schematic all three TC74 sensors have their SDA and SCL pins connected in series to pin A4 and A5 on the Arduino board.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |