Advertisement
coltonspastebin

Temperature showing on LCD

Jan 26th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <LiquidCrystal.h>
  2. LiquidCrystal lcd (2, 3, 4, 5, 6, 7);
  3. const int TempPin = A0;
  4. int tempVal = 0;
  5. int minVal = 0;
  6. int maxVal = 100;
  7. void setup()
  8. {
  9. Serial.begin (9600);
  10. }
  11.  
  12. void loop()
  13. {
  14. tempVal = analogRead (TempPin);
  15. tempVal = map (tempVal, 900, 960, 0, 100);
  16. Serial.println (tempVal);
  17. lcd.clear ();
  18. lcd.setCursor (5, 0);
  19. lcd.print (tempVal);
  20. delay (500);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement