Baskı devresini indir...

KOD: 

#include <Wire.h>

#include "RTClib.h"

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 9, 8, 7, 6);

RTC_DS1307 RTC;

 

void setup () {

    Serial.begin(9600);

    Wire.begin();

    RTC.begin();

    lcd.begin(20, 4);

    pinMode(8,OUTPUT);

 

  if (! RTC.isrunning()) {

   Serial.println("RTC is NOT running!");

    // following line sets the RTC to the date & time this sketch was compiled

   RTC.adjust(DateTime(2015,12,06,00,02,00));// tarih ve saat bilgisi ayarlanıyor...

  }

}

 

void loop () {

    DateTime now = RTC.now();

    lcd.setCursor(0, 0);

    lcd.print("Tarih:");

    Serial.print("TARİH");

    lcd.print(now.day(), DEC);

    lcd.print('/');

    lcd.print(now.month(), DEC);

    lcd.print('/');

    lcd.print(now.year(), DEC);

    lcd.print(' ');

    lcd.setCursor(0, 1);

    lcd.print("Saat :");

     if (now.hour()<10)

    lcd.print('0');

    lcd.print(now.hour(), DEC);

    lcd.print(':');

     if (now.minute()<10)

    lcd.print('0');

    lcd.print(now.minute(), DEC);

    lcd.print(':');

    if (now.second()<10)

    lcd.print('0');

    lcd.print(now.second(), DEC);

    lcd.setCursor(0, 3);

   int dayofweek = now.dayOfWeek();

   switch(dayofweek){

     case 1:

     lcd.print("Pazartesi");

     break;

     case 2:

     lcd.print("Sali");

     break;

     case 3:

     lcd.print("Çarşamba");

     break;

     case 4:

     lcd.print("Perşembe");

     break;

     case 5:

     lcd.print("Cuma");

     break;

     case 6:

     lcd.print("Cumartesi");

     break;

     case 0:

     lcd.print("Pazar");

     break;

    delay(1000);

}

 

}


Yorum ekle


Güvenlik kodu
Yenile

SON YORUMLANANLAR

GELEN GİDEN SAYISI

372991
Bugün
Dün
Bu hafta
Geçen hafta
Bu Ay
Geçen Ay
Tümü
432
815
3225
362919
19522
24549
372991

Your IP: 93.89.232.254
2017-11-22 14:36