iot 13,14
iot 13,14
*/
#include<LiquidCrystal.h>
//pins of the LCD. (RS, E, D4, D5, D6, D7) LiquidCrystal
lcd(6, 7, 5, 4, 3, 2);
Program:
#include<LiquidCrystal.h>
//pins of the LCD. (RS, E, D4, D5, D6, D7) LiquidCrystal
lcd(6, 7, 5, 4, 3, 2);
const int sensor=A0; // Assigning analog pin A1 to variable 'sensor'
float
int Red_LED = 9;
int Green_LED = 10;
void setup()
{
pinMode(Red_LED, OUTPUT);
pinMode(Green_LED, OUTPUT);
pinMode(BUZ, OUTPUT);
pinMode(sensor,INPUT); // Configuring pin A1 as input
Serial.begin(9600);
lcd.begin(16,2);
delay(500);
}
void loop()
{
tempc = (vout*500)/1023;
//vout=vout* 0.48828125;
lcd.setCursor(0,0);
tempc; //variable to store temperature in degree Celsius float
= 223; vout=analogRead(sensor);
lcd.print("***Tempeature***");
lcd.setCursor(0,1)
; lcd.print(tempc);
lcd.print(sign);
lcd.print("C ");
lcd.print(" ");
lcd.print((tempc*
1.8)+32);
lcd.print(sign);
lcd.print("F ");
delay(1000); //Delay of 1 second for ease of viewing in serial monitor