Skip to content

Instantly share code, notes, and snippets.

@li2hub
Last active July 10, 2018 15:29
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 li2hub/b7b9822660f252678e0dfdbf3f007d96 to your computer and use it in GitHub Desktop.
Save li2hub/b7b9822660f252678e0dfdbf3f007d96 to your computer and use it in GitHub Desktop.
float temp;
int tempPin = 0;
void setup()
{
Serial.begin(9600);
}
void loop()
{
temp = analogRead(tempPin);
temp = temp * 0.48828125; //convert into celcius
Serial.print(“TEMPRATURE = “);
Serial.print(temp);
Serial.print(“*C”);
Serial.println();
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment