1. Kondisi [kembali]
Bila suhu yang terbaca pada lcd menunnjukkan suhu kisaran 30-35 derajat celsius maka 1 led berwarna merah dan lainnya mati akan hidup dan jika kisaran 36-40 makan led hijau yang akan hidup dan lainnya mati
2. Rangkaian Simulasi [kembali]
4. Listing Program [kembali]
#include<LiquidCrystal.h>
#define LM35 A0
LiquidCrystal lcd(2,3,4,5,6,7);
int nilaiSuhu;
void setup(){
pinMode(A0,INPUT);
pinMode(8,OUTPUT);
pinMode(9,OUTPUT);
lcd.begin(16,2);
}
void loop()
{
nilaiSuhu=((5*analogRead(LM35)*100.00)/1024/3);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(nilaiSuhu);
delay(100);
if (nilaiSuhu <30)
{digitalWrite (8,LOW);
digitalWrite (9,LOW);}
if (nilaiSuhu >=30)
{digitalWrite (8,HIGH);
digitalWrite (9,LOW);}
if (nilaiSuhu >35)
{digitalWrite (9,HIGH);
digitalWrite (8,LOW);}
if(nilaiSuhu > 40)
{digitalWrite (8,LOW);
digitalWrite (9,LOW);}
}
5. Video [kembali]#include<LiquidCrystal.h>
#define LM35 A0
LiquidCrystal lcd(2,3,4,5,6,7);
int nilaiSuhu;
void setup(){
pinMode(A0,INPUT);
pinMode(8,OUTPUT);
pinMode(9,OUTPUT);
lcd.begin(16,2);
}
void loop()
{
nilaiSuhu=((5*analogRead(LM35)*100.00)/1024/3);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(nilaiSuhu);
delay(100);
if (nilaiSuhu <30)
{digitalWrite (8,LOW);
digitalWrite (9,LOW);}
if (nilaiSuhu >=30)
{digitalWrite (8,HIGH);
digitalWrite (9,LOW);}
if (nilaiSuhu >35)
{digitalWrite (9,HIGH);
digitalWrite (8,LOW);}
if(nilaiSuhu > 40)
{digitalWrite (8,LOW);
digitalWrite (9,LOW);}
}
6. Link Download [kembali]
1. File HTML
Download File
2. Video
Download File
3. File rangkaian simulasi
Download File
Tidak ada komentar:
Posting Komentar