Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <LiquidCrystal.h>
- LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
- int value;
- float celsius;
- const int lmPin = 0; // The analog pin of the LM35
- void setup() {
- lcd.begin(16,2);
- }
- void loop() {
- value = analogRead(inPin);
- celsius = (value / 1023) * 500; // Getting the temperature from the sensor
- lcd.clear();
- lcd.setCursor(0,0);
- lcd.print(celsius);
- lcd.print("C");
- lcd.setCursor(0,1);
- lcd.print((celsius * 9)/5 + 32);
- lcd.print("F");
- delay(1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement