Snippet Tag: mcp9600 thermocouple board

thermocouple arduino code

///// this function will read the hot and cold junction temp int read_temp() { Wire.beginTransmission(Addr); Wire.write(0x00); Wire.endTransmission(); Wire.requestFrom(Addr, 2); if (Wire.available() == 2) { data1 = Wire.read(); data2 = Wire.read(); // Serial.println(data1); // Serial.println(data2); if((data1 & 0x80) == 0x80) { data1 = data1 & 0x7F; temp = 1024 – ( data1 * 16 + data2/16); Serial.print("Temperature :"); Serial.print(temp); Serial.println("n"); } else data1 = data1 *16; data2 = data2 * 0.0625; // Serial.println(data1); // Serial.println(data2); temp = data1 + data2; // temp = ( data1 * 16 + data2/16); Serial.print("Temperature :"); Serial.print(temp); Serial.println("n"); } }

Read More »