Advertisement
Guest User

Untitled

a guest
Oct 18th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. int lmPin = A0;
  2. void setup()
  3. {
  4. Serial.begin(9600);
  5. }
  6. float temp()
  7. {
  8. float raw = analogRead(lmPin);
  9. float percent = raw/1023.0;
  10. float volts = percent*5.0;
  11. return 100.0*volts;
  12. }
  13. void loop()
  14. {
  15. Serial.println(tempC());
  16. delay(200);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement