Using a Temp Sensor with arduino TMP36 Temperature Sensor with Arduino Code



Using a Temp Sensor with arduino Code:

#include <LiquidCrystal.h>
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
float temp;
int tempPin = 0;
void setup(){
lcd.begin(16, 2);
Serial.begin(9600);}
void loop(){
temp = analogRead(tempPin);
temp = temp * 0.48828125;
Serial.print("TEMPRATURE = ");
Serial.print(temp);
Serial.print("*C");
Serial.println();
lcd.setCursor(0, 0);
lcd.print("TMP=");
lcd.print(temp);
lcd.print("C");
delay(1000);}

Comments

Popular posts from this blog

Learning to Pray

Arduino and MQ 2 gas sensor