Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
8 views2 pages

Iot 12

This document contains an Arduino sketch for displaying temperature readings on an LCD using a temperature sensor. It initializes the LCD, creates a custom degree character, and continuously reads the analog value from the sensor to calculate and display the temperature in Celsius. The temperature is also printed to the Serial Monitor every 700 milliseconds.

Uploaded by

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

Iot 12

This document contains an Arduino sketch for displaying temperature readings on an LCD using a temperature sensor. It initializes the LCD, creates a custom degree character, and continuously reads the analog value from the sensor to calculate and display the temperature in Celsius. The temperature is also printed to the Serial Monitor every 700 milliseconds.

Uploaded by

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

// MANASI KALE B-15

#include<LiquidCrystal.h>
#define sensor A0
float analog_value;
LiquidCrystal lcd(2,3,4,5,6,7);

byte degree[8] =
{
0b00011,
0b00011,
0b00000,
0b00000,
0b00000,
0b00000,
0b00000,
0b00000
};

void setup()
{
lcd.createChar(1, degree);
lcd.begin(16,2);
Serial.begin(9600);
pinMode(sensor, INPUT);
lcd.setCursor(0,0);
lcd.print("Temperature Plot");
lcd.setCursor(0,1);
lcd.print("Using Proccesing");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.setCursor(0,1);
delay(2000);
lcd.clear();
}

void loop()
{
float reading=analogRead(sensor);
analog_value=reading*(5.0/1023.0)*100;

lcd.setCursor(0,0);
lcd.print(" Temperature ");
lcd.setCursor(4,1);
lcd.print(analog_value);
lcd.write(1);
lcd.print("C");
Serial.println(analog_value);
delay(700);
}

You might also like