Skip to content

Instantly share code, notes, and snippets.

@not-for-me
Created December 31, 2014 02:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save not-for-me/250af8d876e6d494632f to your computer and use it in GitHub Desktop.
Save not-for-me/250af8d876e6d494632f to your computer and use it in GitHub Desktop.
float tempC;
int reading;
int tempPin = 0;
void setup()
{
Serial.begin(9600);
analogReference(INTERNAL);
}
void loop()
{
reading = analogRead(tempPin);
tempC = reading / 9.31;
Serial.print("Temp: "); //Display the temperature on Serial monitor
Serial.print(tempC);
Serial.println("C");
delay(2000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment