public
Created

Arduino 22 - TC74 Code

  • Download Gist
gistfile1.c
C
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
#include <Wire.h>
 
#define i2c_addr 0x4F
 
void setup() {
Serial.begin(9600);
Wire.begin();
}
 
void loop() {
Serial.print("reading:");
 
Wire.beginTransmission(i2c_addr);
Wire.send((uint8_t) 0);
Wire.endTransmission();
Wire.requestFrom(i2c_addr, 1);
int tempC = Wire.receive();
Serial.print(tempC);
Serial.print(" degrees C; ");
int tempF = (tempC * 1.8) + 32;
Serial.print (tempF);
Serial.println(" degrees F");
delay(1000);
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.