Skip to content

Instantly share code, notes, and snippets.

@samuelsonbrito
Last active October 7, 2021 21:08
Show Gist options
  • Save samuelsonbrito/b021f1d9ae89aa17de391cc67ecfb999 to your computer and use it in GitHub Desktop.
Save samuelsonbrito/b021f1d9ae89aa17de391cc67ecfb999 to your computer and use it in GitHub Desktop.
Lm35 - Arduino
const int LM35 = A0;
double temperatura;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
temperatura = (double(analogRead(LM35))*5/(1023))/0.01;
Serial.println(temperatura);
delay(2000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment