Kuluçka Makinesi v.3

Yapmış olduğum kuluçka makinasının nasıl ayarlandığını görmek için aşağıdaki videoya bakabilirsiniz

YAZILIM

 
#include <OneWire.h> // OneWire kütüphane dosyası çağrıldı

#include <DallasTemperature.h> // DallasTemperature kütüphane dosyası çağrıldı

// kullanılacak arduino dijital pini seçiliyor ne oneWire adlı bir nesne oluşturuluyor

OneWire oneWire(13);

DallasTemperature DS18B20(&oneWire);
DeviceAddress DS18B20adres;
#include <LiquidCrystal.h>
LiquidCrystal lcd(3, 2, 8, 9, 10, 12);
unsigned long eskiZaman=0;
unsigned long yeniZaman;
int ilkkusurat;
int sonkusurat;
int refkusurat;
int iyuzler, ionlar, ibirler,ronlar,rbirler,ryuzler;
int syuzler, sonlar, sbirler;
float santigrat, fahrenheit;
#include <EEPROM.h>

int say_address = 41;       
int sgun_address = 42;   
int yay_address = 51;       
int ygun_address = 52;       
int yisi_caddress = 53;       
int yssi_caddress = 54;      
int ref_caddress = 55;       
int durum_caddress = 56;         
int basla_caddress = 57;                                 // the variable which holds the address in the eeprom

int iyuzler_caddress =58;
int ionlar_caddress =59;
int ibirler_caddress =60;
 
int syuzler_caddress =61;
int sonlar_caddress =62;
int sbirler_caddress =63;


int ryuzler_caddress =64;
int ronlar_caddress =65;
int rbirler_caddress =66;



//int led=A4;
int buzzer = A1;
int role=4;
//****************sıcaklık***************
//#include <dht11.h>
//dht11 DHT11; 
float sicaklik = 0;
//****************sıcaklık***************
int servoiki_durum=0;
int servobir_durum=0;
//***********buton*******************

int aci=90;
int menu=0;
//***********buton*******************


//*****************saat**********************
#include <DS1302RTC.h>
#include <Streaming.h>       
  static time_t tLast;
  time_t t;
  tmElements_t tm;
#include <TimeLib.h>
DS1302RTC RTC(5, 6, 7);
//            rst,data,clk
int yil = 0 ;
int ay;
int gun ;
int saat;
int dakika ;
int saniye ;
int s_ay=0;
int s_gun=0;

int y_ay=0;
int y_gun=0;
float y_sic=0;
float s_sic=0;
float ref=0;
int basla=0;
#include<Servo.h>
Servo sg90;
int durum=0;
void setup()
{
  Serial.begin(9600);  // serial ekran haberleşme portalı 
  DS18B20.begin(); 
  DS18B20.getAddress(DS18B20adres, 0); 
  DS18B20.setResolution(DS18B20adres, 12);
pinMode(buzzer,OUTPUT);
pinMode(role,OUTPUT);
digitalWrite(role,LOW);
  lcd.begin(16, 2);
//  DHT11.attach(13);
  Serial << F("RTC module activated");
  Serial << endl;
  delay(500);

  if (RTC.haltRTC()) {
    Serial << F("The DS1302 is stopped.  Please set time");
    Serial << F("to initialize the time and begin running.");
    Serial << endl;
  }
  if (!RTC.writeEN()) {
    Serial << F("The DS1302 is write protected. This normal.");
    Serial << endl;
  }
lcd.setCursor (0,0);
lcd.print("KULUCKA KAKINASI");
lcd.setCursor (0,1);
lcd.print("  BASLATILIYOR  ");
  delay(5000);
  setSyncProvider(RTC.get);

  Serial << F("RTC Sync");
  if (timeStatus() == timeSet)
    Serial << F(" Ok!");
  else
    Serial << F(" FAIL!");
  Serial << endl;



  sg90.attach(11); 
lcd.clear();
 
 s_ay = EEPROM.read(say_address);  
 s_gun = EEPROM.read(sgun_address);  
 y_ay = EEPROM.read(yay_address);  
 y_gun = EEPROM.read(ygun_address);  
 y_sic = EEPROM.read(yisi_caddress);  
 s_sic = EEPROM.read(yssi_caddress);  
 ref = EEPROM.read(ref_caddress);  
 durum = EEPROM.read(durum_caddress);  
 basla = EEPROM.read(basla_caddress);  




 iyuzler = EEPROM.read(iyuzler_caddress);  
 ionlar = EEPROM.read(ionlar_caddress);  
 ibirler = EEPROM.read(ibirler_caddress);  
 
 syuzler = EEPROM.read(syuzler_caddress);  
 sonlar = EEPROM.read(sonlar_caddress);  
 sbirler = EEPROM.read(sbirler_caddress);  
 
 ryuzler = EEPROM.read(ryuzler_caddress);  
 ronlar = EEPROM.read(ronlar_caddress);  
 rbirler = EEPROM.read(rbirler_caddress);  


ref=((ryuzler*100)+(ronlar*10)+rbirler)/10.0;
s_sic=((syuzler*100)+(sonlar*10)+sbirler)/10.0;
y_sic=((iyuzler*100)+(ionlar*10)+ibirler)/10.0;

//ref=0.1;
//s_sic=35.2;
//y_sic=35.2;
//durum=0;
//basla=0;
 
sg90.write(aci); 
}
 void buton_oku()
{Serial.println(menu);
   if ( analogRead(A4)>500 )menu++;
   if ( analogRead(A5)>500 )menu--;
  if (menu > 14)menu = 0;
  if (menu < 0)menu = 0;

  while( analogRead(A5)>500 || analogRead(A4)>500 ){}
}





void loop()
{
  buton_oku();
  t = now();
  if (t != tLast) {
    tLast = t;
    printDateTime(t);
    Serial << endl;
  }
 DS18B20.requestTemperatures();
 sicaklik = DS18B20.getTempC(DS18B20adres);

   yeniZaman = millis(); 


   if ( analogRead(A2)>500 && analogRead(A3)>500)
   {
    
durum=0;
      y_gun=0;
      y_ay=0;
      s_gun=0;
      s_ay=0;
  EEPROM.write(sgun_address,(s_gun));  
  EEPROM.write(say_address,(s_ay));  
  EEPROM.write(ygun_address,(y_gun));  
  EEPROM.write(yay_address,(y_ay));  
EEPROM.write(durum_caddress,(durum));  
digitalWrite(role,LOW);
sg90.write(90); 
delay(3000);

   }

if(y_ay == ay && y_gun == gun && durum==0 )
{
  durum=1;
lcd.setCursor (0, 0);lcd.print("  ZAMAN  DOLDU  ");
lcd.setCursor (0, 1);lcd.print("  SON  3  GUN   ");
if(aci > 90)
{
  for(aci=135 ; aci>90 ;aci--)
{
  
sg90.write(aci); 
delay(100);
}
}

else
{
  for(aci=45 ; aci<135 ;aci++)
{
  
sg90.write(aci); 
delay(100);
}
  
}
sg90.write(90); 

  EEPROM.write(durum_caddress,(durum));  

delay(3000);
lcd.clear();
  eskiZaman = yeniZaman;
}

while (durum==1)
{
   if ( analogRead(A2)>500 && analogRead(A3)>500)
   {
    
durum=0;
      y_gun=0;
      y_ay=0;
      s_gun=0;
      s_ay=0;
  EEPROM.write(sgun_address,(s_gun));  
  EEPROM.write(say_address,(s_ay));  
  EEPROM.write(ygun_address,(y_gun));  
  EEPROM.write(yay_address,(y_ay));  
EEPROM.write(durum_caddress,(durum));  
digitalWrite(role,LOW);

sg90.write(90); 
delay(3000);





   }

  lcd.setCursor (0,0);lcd.print("+");
  delay(1000);

 DS18B20.requestTemperatures();
 sicaklik = DS18B20.getTempC(DS18B20adres);

lcd.setCursor (1,0);if(ay<10)lcd.print("0"); lcd.print(ay);lcd.print(".");if(gun<10)lcd.print("0"); lcd.print(gun); lcd.print("   / ");if(s_ay<10)lcd.print("0");lcd.print(s_ay);lcd.print("."); if(s_gun<10)lcd.print("0");lcd.print(s_gun); 

 
  lcd.setCursor (0,1);
lcd.print("ISI:"); lcd.print(sicaklik); lcd.print("/ ");lcd.print(s_sic);

  lcd.setCursor (0,0);lcd.print(" ");
  delay(1000);

  
if(s_ay == ay && s_gun == gun)
{
durum=0;
basla=0;
      y_gun=0;
      y_ay=0;
  EEPROM.write(basla_caddress,(basla));  
  EEPROM.write(ygun_address,(y_gun));  
  EEPROM.write(yay_address,(y_ay));  
EEPROM.write(durum_caddress,(durum));  
digitalWrite(role,LOW);
lcd.setCursor (0, 0);lcd.print("CIKIM TAMAMLANDI"); 
lcd.setCursor (0, 1);lcd.print("CIHAZA RESET AT!");
while(1)
{ 
  for(int a=0;a<1024;a=a+100)
  {
  tone(buzzer,a);
  delay(50);
  delay(50);
  }
noTone(buzzer);
  delay(150);


  
}
}
  else
  {
  
  if(sicaklik > s_sic){
    digitalWrite(role,LOW);// kapalı demek lamba yanar
delay(100);
  }
 if(sicaklik <= s_sic-ref){
  digitalWrite(role,HIGH);
delay(100);
 }
  }


}

if(y_ay!=0 && y_gun!=0 && s_ay !=0 && s_gun !=0)
{
  
if(sicaklik > y_sic ) {
  digitalWrite(role,LOW);
delay(100);
}
if(sicaklik <= y_sic-ref) {
  digitalWrite(role,HIGH);
delay(100); 
}
if(second(t)==0 || second(t)==20 || second(t)==40){
  
lcd.setCursor (0,1);lcd.print("T");if(y_ay<10)lcd.print("0");lcd.print(y_ay);lcd.print(":");if(y_gun<10)lcd.print("0");lcd.print(y_gun);
}
else if(second(t)==10 || second(t)==30 || second(t)==50){
  
lcd.setCursor (0,1);lcd.print("R");lcd.print(y_sic);
}
lcd.setCursor (6,1);
lcd.print(" ISI:"); lcd.print(sicaklik); 

}
else
{
lcd.setCursor (0,1);
  
if(y_ay==0 && y_gun==0 && s_ay ==0 && s_gun ==0)lcd.print(" BOSTA BEKLIYOR "); 
else if(y_ay==0) lcd.print("ILK AY GIRINIZ  "); 

else if(y_gun==0)lcd.print("ILK GUN GIRINIZ "); 

else if(s_ay ==0)lcd.print("SON AY GIRINIZ  "); 

else if(s_gun==0)lcd.print("SON GUN GIRINIZ "); 

  digitalWrite(role,LOW);
}
//Serial.print("servo_durum ");Serial.println(servo_durum);


if(((saat == 0) || (saat == 4) ||(saat == 8) ||(saat == 12) ||(saat == 16) ||(saat == 20)) && servobir_durum==0 )
{
servobir_durum=1;
servoiki_durum=0;

lcd.setCursor (0,0);lcd.print("   VILOR TERS   ");
lcd.setCursor (0,1);lcd.print("   CEVRILIYOR   ");
for(aci;aci>45 ;aci--)
{
  
sg90.write(aci); 
delay(100);
}

lcd.clear();
}

if(((saat == 2) || (saat == 6) ||(saat == 10) ||(saat == 14) ||(saat == 18) ||(saat == 22))&& servoiki_durum ==0 )
{
  servoiki_durum=1;
servobir_durum=0;
lcd.setCursor (0,0);lcd.print("   VILOR TERS   ");
lcd.setCursor (0,1);lcd.print("   CEVRILIYOR   ");
for(aci;aci<135 ;aci++)
{
  
sg90.write(aci); 
delay(100);
}
lcd.clear();
}

 
  while (menu == 1) {
lcd.setCursor (0,1);
lcd.print("                ");
    Serial << F("Error: Year must be two digits or four digits!") << endl;

    if ( analogRead(A2)>500 )
    {
      yil ++;
      while( analogRead(A2)>500 ){}

    }


    if ( analogRead(A3)>500 )
    {
      yil--;
      while( analogRead(A3)>500 ){}

    }


    saat_ayari();
   buton_oku();
  }
  while (menu == 2) {



    Serial << F("Error: Year must be two digits or four digits!") << endl;


    if ( analogRead(A2)>500 )
    {
      ay ++;
      while( analogRead(A2)>500 ){}

    }


   if ( analogRead(A3)>500 )
    {
      ay --;
      while( analogRead(A3)>500 ){}

    }

    saat_ayari();
    buton_oku();
  
  }
  while (menu == 3) {

    


    Serial << F("Error: Year must be two digits or four digits!") << endl;


    if ( analogRead(A2)>500 )
    {
      gun ++;
      while( analogRead(A2)>500 ){}

    }


   if ( analogRead(A3)>500 )
    {
      gun --;
      while( analogRead(A3)>500 ){}

    }



    saat_ayari();
//    zaman_yaz(); 
    buton_oku();
  
  }
  while (menu == 4) {

    

    Serial << F("Error: Year must be two digits or four digits!") << endl;


    if ( analogRead(A2)>500 )
    {
      saat ++;
      while( analogRead(A2)>500 ){}

    }


   if ( analogRead(A3)>500 )
    {
      saat --;
      while( analogRead(A3)>500 ){}

    }

    saat_ayari();
//    zaman_yaz();
    buton_oku();
   
  }
  while (menu == 5) {

    


    Serial << F("Error: Year must be two digits or four digits!") << endl;


    if ( analogRead(A2)>500 )
    {
      dakika ++;
      while( analogRead(A2)>500 ){}

    }

   if( analogRead(A3)>500 )
    {
      dakika --;
      while( analogRead(A3)>500 ){}

    }
    saat_ayari(); 
//    zaman_yaz();
    buton_oku();
 
  }
while (menu == 6) {

  
    if ( analogRead(A2)>500 )
    {
      y_ay ++;
    if(y_ay>12)y_ay=1;
      while( analogRead(A2)>500 ){}
  EEPROM.write(yay_address,(y_ay));  

    }

   if( analogRead(A3)>500 )
    {
      y_ay --;
    if(y_ay<1)y_ay=12;
      while( analogRead(A3)>500 ){}
  EEPROM.write(yay_address,(y_ay));  

    }
    
lcd.setCursor (0, 0);lcd.print("> ILK AY  : "); if(y_ay<10)lcd.print("0");lcd.print(y_ay);lcd.print("    "); 
lcd.setCursor (0, 1);lcd.print("  ILK GUN : "); if(y_gun<10)lcd.print("0");lcd.print(y_gun);lcd.print("    "); 
    buton_oku();
}
  
  while (menu == 7) {

  
    if ( analogRead(A2)>500 )
    {
      y_gun ++;
    if(y_gun>31)y_gun=1;
      while( analogRead(A2)>500 ){}
  EEPROM.write(ygun_address,(y_gun));  

    }

   if( analogRead(A3)>500 )
    {
      y_gun --;
    if(y_gun<1)y_gun=31;
      while( analogRead(A3)>500 ){}
  EEPROM.write(ygun_address,(y_gun));  

    }
    
lcd.setCursor (0, 0);lcd.print("  ILK AY  : "); if(y_ay<10)lcd.print("0");lcd.print(y_ay);lcd.print("    "); 
lcd.setCursor (0, 1);lcd.print("> ILK GUN : "); if(y_gun<10)lcd.print("0");lcd.print(y_gun);lcd.print("    "); 
    buton_oku();
}

  while (menu == 8) {

  
    if ( analogRead(A2)>500 )
    {
      s_ay ++;
    if(s_ay>12)s_ay=1;
      while( analogRead(A2)>500 ){}
  EEPROM.write(say_address,(s_ay));  

    }

   if( analogRead(A3)>500 )
    {
      s_ay --;
    if(s_ay<1)s_ay=12;
      while( analogRead(A3)>500 ){}
  EEPROM.write(say_address,(s_ay));  

    }
    
lcd.setCursor (0, 0);lcd.print("> SON AY : "); if(s_ay<10)lcd.print("0");lcd.print(s_ay);lcd.print("    "); 
lcd.setCursor (0, 1);lcd.print("  SON GUN: "); if(s_gun<10)lcd.print("0");lcd.print(s_gun);lcd.print("    "); 
    buton_oku();
}

 while (menu == 9) {

  
    if ( analogRead(A2)>500 )
    {
      s_gun ++;
    if(s_gun>31)s_gun=1;
      while( analogRead(A2)>500 ){}
  EEPROM.write(sgun_address,(s_gun));  

    }

   if( analogRead(A3)>500 )
    {
      s_gun --;
    if(s_gun<1)s_gun=31;
      while( analogRead(A3)>500 ){}
  EEPROM.write(sgun_address,(s_gun));  

    }
    
lcd.setCursor (0, 0);lcd.print("  SON AY : "); if(s_ay<10)lcd.print("0");lcd.print(s_ay);lcd.print("    "); 
lcd.setCursor (0, 1);lcd.print("> SON GUN: "); if(s_gun<10)lcd.print("0");lcd.print(s_gun);lcd.print("    "); 
    buton_oku();
}

  
    while (menu == 10) {

  
    if ( analogRead(A2)>500 )
    {
      y_sic=y_sic+0.1;
    if(y_sic>60)y_sic=0;
    if(y_sic<20)y_sic=60;
      while( analogRead(A2)>500 ){}
ilkkusurat=y_sic*10;

 iyuzler = ilkkusurat / 100;
 ilkkusurat = ilkkusurat - (iyuzler * 100);
 ionlar = ilkkusurat / 10;
 
 ilkkusurat = ilkkusurat - (ionlar * 10);
 ibirler = ilkkusurat;
  EEPROM.write(iyuzler_caddress,(iyuzler));  
  EEPROM.write(ionlar_caddress,(ionlar));  
  EEPROM.write(ibirler_caddress,(ibirler));  

    }

   if( analogRead(A3)>500 )
    {
      y_sic=y_sic-0.1;
    if(y_sic<1)y_sic=60;
    if(y_sic>60)y_sic=20;
      while( analogRead(A3)>500 ){}
ilkkusurat=y_sic*10;

 iyuzler = ilkkusurat / 100;
 ilkkusurat = ilkkusurat - (iyuzler * 100);
 ionlar = ilkkusurat / 10;
 
 ilkkusurat = ilkkusurat - (ionlar * 10);
 ibirler = ilkkusurat;
  EEPROM.write(iyuzler_caddress,(iyuzler));  
  EEPROM.write(ionlar_caddress,(ionlar));  
  EEPROM.write(ibirler_caddress,(ibirler));  

    }
    
lcd.setCursor (0, 0);lcd.print(">Y.ILK ISI:"); if(y_sic<10)lcd.print("0");lcd.print(y_sic);lcd.print("    "); 
lcd.setCursor (0, 1);lcd.print(" Y.SON ISI:"); if(s_sic<10)lcd.print("0");lcd.print(s_sic);lcd.print("    "); 
    buton_oku();
}
  while (menu == 11) {

  
    if ( analogRead(A2)>500 )
    {

      s_sic=s_sic+0.1;
    if(s_sic>60)s_sic=0;
    if(s_sic<20)s_sic=60;
      while( analogRead(A2)>500 ){} 

sonkusurat=s_sic*10;

 syuzler = sonkusurat / 100;
 sonkusurat = sonkusurat - (syuzler * 100);
 sonlar = sonkusurat / 10;
 
 sonkusurat = sonkusurat - (sonlar * 10);
 sbirler = sonkusurat;
  EEPROM.write(syuzler_caddress,(syuzler));  
  EEPROM.write(sonlar_caddress,(sonlar));  
  EEPROM.write(sbirler_caddress,(sbirler));  
      
//  EEPROM.write(yssi_caddress,(s_sic));  

    }

   if( analogRead(A3)>500 )
    {
      s_sic=s_sic-0.1;
    if(s_sic<20)s_sic=60;
    if(s_sic>601)s_sic=20;
      while( analogRead(A3)>500 ){}
sonkusurat=s_sic*10;

 syuzler = sonkusurat / 100;
 sonkusurat = sonkusurat - (syuzler * 100);
 sonlar = sonkusurat / 10;
 
 sonkusurat = sonkusurat - (sonlar * 10);
 sbirler = sonkusurat;
  EEPROM.write(syuzler_caddress,(syuzler));  
  EEPROM.write(sonlar_caddress,(sonlar));  
  EEPROM.write(sbirler_caddress,(sbirler));  

    }
    
lcd.setCursor (0, 0);lcd.print(" Y.ILK ISI:"); if(y_sic<10)lcd.print("0");lcd.print(y_sic);lcd.print("    "); 
lcd.setCursor (0, 1);lcd.print(">Y.SON ISI:"); if(s_sic<10)lcd.print("0");lcd.print(s_sic);lcd.print("    "); 
    buton_oku();
}
 
    while (menu == 12) {

  
    if ( analogRead(A2)>500 )
    {
      ref=ref+0.1;
    if(ref>2)ref=0;
      while( analogRead(A2)>500 ){} 
refkusurat=ref*10;

 ryuzler = refkusurat / 100;
 refkusurat = refkusurat - (ryuzler * 100);
 ronlar = refkusurat / 10;
 
 refkusurat = refkusurat - (ronlar * 10);
 rbirler = refkusurat;
  EEPROM.write(ryuzler_caddress,(ryuzler));  
  EEPROM.write(ronlar_caddress,(ronlar));  
  EEPROM.write(rbirler_caddress,(rbirler));  

    }

   if( analogRead(A3)>500 )
    {
      ref=ref-0.1;
    if(ref<0)s_sic=2;
      while( analogRead(A3)>500 ){}
refkusurat=ref*10;

 ryuzler = refkusurat / 100;
 refkusurat = refkusurat - (ryuzler * 100);
 ronlar = refkusurat / 10;
 
 refkusurat = refkusurat - (ronlar * 10);
 rbirler = refkusurat;
  EEPROM.write(ryuzler_caddress,(ryuzler));  
  EEPROM.write(ronlar_caddress,(ronlar));  
  EEPROM.write(rbirler_caddress,(rbirler));  

    }

lcd.setCursor (0, 0);lcd.print(" Y.SON ISI:"); if(s_sic<10)lcd.print("0");lcd.print(s_sic);lcd.print("    ");     
lcd.setCursor (0, 1);lcd.print(">REF   ISI:"); if(ref<10)lcd.print("0");lcd.print(ref);lcd.print("    "); 
    buton_oku();
}
  
  
    while (menu == 13) 
    {
lcd.setCursor (0, 0);lcd.print("MAKINE CALISMAYA"); 
lcd.setCursor (0, 1);lcd.print("CALISMAYA HAZIR "); 

   if ( analogRead(A5)>500 )menu--;
   if ( analogRead(A4)>500 )menu++;
  if (menu > 14)menu = 0;
  if (menu < 0)menu = 0;


    
    }
  if(menu == 14)
  {
    
   // //digitalWrite(led,LOW);
lcd.setCursor (0, 0);lcd.print("VIYOL AYARLANIYO"); 
lcd.setCursor (0, 1);lcd.print("****************"); 
      basla=1;
  EEPROM.write(basla_caddress,(basla)); 
  delay(2000);
lcd.setCursor (0,1);lcd.print("R");lcd.print(y_sic);
menu=0;
for(aci;aci<135 ;aci++)
{
  
sg90.write(aci); 
delay(100);
}


  
  }
  
  

  
}






void saat_ayari()
{
  static time_t tLast;
  time_t t;
  tmElements_t tm;

  //int ay=12;
  tm.Year = 51 + yil;
  tm.Month = ay;
  tm.Day = gun;
  tm.Hour = saat;
  tm.Minute = dakika;
  tm.Second = saniye;
  t = makeTime(tm);
  if (RTC.set(t) == 0) { // Success
    setTime(t);
    Serial << F("RTC set to: ");
    printDateTime(t);
    Serial << endl;
  }
  else
    Serial << F("RTC set failed!") << endl;
  t = now();
  if (t != tLast) {
    tLast = t;
    printDateTime(t);
    Serial << endl;
  }
}


void printDateTime(time_t t)
{
  printDate(t);
  Serial << ' ';
  printTime(t);
}
void printTime(time_t t)
{
  printI00(hour(t), ':');
  printI00(minute(t), ':');
  printI00(second(t), ' ');

  saat = hour(t) ;
  dakika = minute(t) ;
  saniye = second(t);



  if(menu == 1)
  {
lcd.setCursor (0, 0);
lcd.print("YIL AYARI :"); 
lcd.print(year(t)); 
lcd.print(" "); 
    
  }


  else
  {
    lcd.setCursor (0, 0);lcd.print(" ");
lcd.setCursor (1, 0);if (month(t) < 10)lcd.print("0"); lcd.print(month(t));
lcd.setCursor (4, 0);if (day(t) < 10)  lcd.print("0"); lcd.print(day(t));

 lcd.setCursor (8, 0); if (hour(t) < 10)    lcd.print("0");  lcd.print(hour(t));
  
 lcd.setCursor (11, 0); if (minute(t) < 10)    lcd.print("0");  lcd.print(minute(t));

 lcd.setCursor (14, 0); if (second(t) < 10)    lcd.print("0");  lcd.print(second(t));

 
    
    if (menu == 2){ lcd.setCursor (3, 0); lcd.print("<");
lcd.setCursor (0, 1);
lcd.print("AY AYARI        "); 
    }     
    else     { lcd.setCursor (3, 0); lcd.print(":");}

    if (menu == 3){ lcd.setCursor (6, 0); lcd.print("< ");
lcd.setCursor (0, 1);
lcd.print("GUN AYARI       "); }     
    else     { lcd.setCursor (6, 0); lcd.print("  ");}
    
    if (menu == 4){ lcd.setCursor (10, 0); lcd.print("<");
    
lcd.setCursor (0, 1);
lcd.print("SAAT AYARI    "); }     
    else     { lcd.setCursor (10, 0); lcd.print(":");}
    
   if (menu == 5){ lcd.setCursor (13, 0); lcd.print("<");
   
lcd.setCursor (0, 1);
lcd.print("DAKIKA AYARI    "); }     
    else     { lcd.setCursor (13, 0); lcd.print(":");}
  }
}
void printDate(time_t t)
{
  printI00(day(t), 0);
  Serial << monthShortStr(month(t)) << _DEC(year(t));



  //    yil =  year(t);
  ay = month(t) ;
  gun = day(t) ;


}
void printI00(int val, char delim)
{
  if (val < 10) Serial << '0';
  Serial << _DEC(val);
  if (delim > 0) Serial << delim;
  return;
}

Sosyal Medyada Paylaş Facebook Twitter Google+

Etiketler: ,
Eklenme Tarihi: 25 Ekim 2021

Konu hakkında yorumunuzu yazın

UA-46017808-1

HOŞ GELDİNİZ

Youtube kanalıma Abone Olabilirsiniz.