Skip to content

Instantly share code, notes, and snippets.

@willasaywhat
Created January 10, 2012 01:43
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save willasaywhat/1586278 to your computer and use it in GitHub Desktop.
Save willasaywhat/1586278 to your computer and use it in GitHub Desktop.
Arduino 22 - TC74 Code
#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);
}
@Ariffffff
Copy link

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment