Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <LiquidCrystal.h>
- LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
- void setup()
- {
- pinMode(A5,INPUT);
- lcd.begin(16,2);
- }
- void loop()
- {
- int TempSensor = analogRead(A5);
- float volt = (TempSensor/1024.0)*5.0;
- float TempCelcius = (volt-0.5)*100.0;
- float TempFarenheit = (TempCelcius*9/5)+32;
- lcd.setCursor(0,0);
- lcd.print("Celcius:");
- lcd.setCursor(8,0);
- lcd.print(TempCelcius);
- lcd.setCursor(0,1);
- lcd.print("Farenheit:");
- lcd.setCursor(10,1);
- lcd.print(TempFarenheit);
- delay(1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement