Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void setup() {
- pinMode(A0,INPUT);
- Serial.begin (9600);
- }
- float val;
- void loop() {
- // put your main code here, to run repeatedly:
- val=analogRead(A0);
- float milivolt = (val/1024.0) * 5000;
- float kelvin= (millivolt/10);
- float celsius= kelvin - 273.15;
- Serial.println(celsius);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement