Skip to content

Instantly share code, notes, and snippets.

@penpencool
Created July 3, 2018 06:14
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 penpencool/cb93b496662c20d6780d1fe048e3ce34 to your computer and use it in GitHub Desktop.
Save penpencool/cb93b496662c20d6780d1fe048e3ce34 to your computer and use it in GitHub Desktop.
/*
Example for Arduino Uno
By ArduinoAll
- - Gnd
+ - 5V
Out - A5
*/
float tempC;
int reading;
int tempPin = A0;
void setup()
{
analogReference(INTERNAL);
Serial.begin(9600);
}
void loop()
{
reading = analogRead(tempPin);
tempC = reading / 9.31;
Serial.println(tempC);
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment