0% found this document useful (0 votes)
7 views1 page

New 3

Uploaded by

june cadayona
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

New 3

Uploaded by

june cadayona
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

int t = 0;

int sensor = A0;


float temp;
float tempf;
float tempk;

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 2, 16);

void setup() {
pinMode(sensor, INPUT);
lcd.begin();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print(" ARDUINO ");
lcd.setCursor(0, 1);
lcd.print("TEMPRETURE METER");
delay(2000);
Serial.begin(9600);
}

void loop() {
delay(2000);
t = t + 2;
temp = analogRead(sensor);
tempf = (temp * 5.0) / 10.0 * 1.8 + 32.0;
tempk = tempf + 459.67;

Serial.println("_______");
Serial.println("Temperature Logger");
Serial.print("Time in Seconds= ");
Serial.println(t);
Serial.print("Temp in deg Fahrenheit = ");
Serial.println(tempf);
Serial.print("Temp in deg Kelvin = ");
Serial.println(tempk);

lcd.setCursor(0, 0);
lcd.print("Temp in F = ");
lcd.println(tempf);
lcd.setCursor(0, 1);
lcd.print("Temp in K = ");
lcd.println(tempk);
}

You might also like