Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. void setup() {
  2.   pinMode(A0,INPUT);
  3.   Serial.begin (9600);
  4. }
  5. float val;
  6.  
  7. void loop() {
  8.   // put your main code here, to run repeatedly:
  9. val=analogRead(A0);
  10. float milivolt = (val/1024.0) * 5000;
  11. float kelvin= (millivolt/10);
  12. float celsius= kelvin - 273.15;
  13. Serial.println(celsius);
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement