Hello arduino enthusiasts :),
I recently bought Arduino Uno and I am trying to create a thermal regulator device. For this purpose I also bought two TCN75A thermal sensors. I am able to connect one of the sensors, and get the temperature readings, but I am not sure how to connect the second one. Here is what I have done so far:
Schematics:
- SDA -> ?4
- SCL -> ?5
- Vcc -> 5V
- GND -> GND
Code:
#include <Wire.h>
int reading = 0;
float temperature = 0;
void setup(){
Serial.begin(9600);
Wire.begin();
///// sets resolution for the measurement
Wire.beginTransmission(B1001000);
Wire.send(0x01);
Wire.send(0x60);
Wire.endTransmission();
Wire.beginTransmission(B1001000);
Wire.send(0x00);
Wire.endTransmission();
}
void loop(){
Wire.requestFrom(B1001000, 2);
reading = Wire.receive();
reading = reading << 8;
reading |= Wire.receive();
reading = reading >> 4;
temperature = (float)reading/16; // ??????? ?? 16 ?????????? ????
Serial.println(temperature,3); // ????? ???????? ? ?? ??? ???
// ? 3 ????? ???? ?????????
delay(500);
}
Thanks is advance.
Best regards