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

Script Program Kipas Angin Otomatis

The document contains code to read temperature from an LM35 sensor and display it on an LCD while controlling a motor based on the temperature threshold of 30 degrees Celsius.

Uploaded by

Rizky Aditya
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)
27 views1 page

Script Program Kipas Angin Otomatis

The document contains code to read temperature from an LM35 sensor and display it on an LCD while controlling a motor based on the temperature threshold of 30 degrees Celsius.

Uploaded by

Rizky Aditya
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/ 1

#include <LiquidCrystal.

h>
LiquidCrystal lcd(7,6,5,4,3,2);
float tempC = 13;
int LM35 = A0, hasil;
char a[16];
int motor = 1;

 
void setup(){
lcd.begin(16,2);
lcd.setCursor(0,0);
lcd.print("SUHU RUANGAN");
pinMode(motor,OUTPUT);
}

void loop(){
tempC = analogRead(LM35);
tempC = (5.0*tempC*100.0)/1024.0;
hasil = (int)tempC;

lcd.setCursor(0,1);
sprintf(a,"SUHU=%d",hasil);
lcd.print(a);
lcd.print((char)223);
lcd.print("C");

if(hasil>30){
digitalWrite(motor,HIGH);
}

if(hasil<30){
digitalWrite(motor,LOW);
}
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy