Skip to content

Instantly share code, notes, and snippets.

@ashton
Created January 24, 2011 01:29
Show Gist options
  • Save ashton/792661 to your computer and use it in GitHub Desktop.
Save ashton/792661 to your computer and use it in GitHub Desktop.
Termômetro feito com display LCD, LM35 e Arduino
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
void setup() {
lcd.begin(16,2);
lcd.print("Temperatura:");
}
void loop() {
int leitura = analogRead(A0);
float tempC = (5.0 * leitura * 100.0)/1024.0;
lcd.setCursor(0,1);
lcd.print(tempC);
lcd.print(" C");
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment