ARDUINO DERS-29 (LM35 İLE SICAKLIK ÖLÇÜMÜ)
DEVRE ŞEMASI
MALZEMELER
- lm35
- 5110 lcd
- arduıno uno
DEVRE KODU
#include <LCD5110_Basic.h>
LCD5110 myGLCD(8,9,10,11,12);
extern uint8_t SmallFont[];
extern uint8_t MediumNumbers[];
extern uint8_t BigNumbers[];
const int analogPin = A0;
float gerilimDeger = 0;
float sensorDeger = 0;
float sicaklikDeger = 0;
int a=0;
int b=100;
////////////////////////////////////////
void setup() {
myGLCD.InitLCD();
}
////////////////////////////////////////
void loop() {
sensorDeger = analogRead(analogPin);
sicaklikDeger = ((sensorDeger/1023)*5000)/10.0;
myGLCD.setFont(MediumNumbers);
myGLCD.setFont(SmallFont);
myGLCD.print("Sicaklik", CENTER, 0);
myGLCD.printNumF(sicaklikDeger,3,CENTER,8,'.',6);
////////////////////////////////////////
if(a<sicaklikDeger){
a=sicaklikDeger;
myGLCD.print("Max Sicaklik", CEN TER, 16);
myGLCD.printNumI(a ,CENTER,24);
}
//////////////////////////////////////
if(b>sicaklikDeger){
b=sicaklikDeger;
myGLCD.print("Min Sicaklik", CENTER, 32);
myGLCD.printNumI(b,CENTER,40);
}
//////////////////////////////////////
delay(1000);
}
Yorumlar
Yorum Gönder