Skip to main content

RTC Dengan Arduino

Selamat sore teman teman howrudi, setelah kita membahas pembuatan jam digital menggunakan sevent segment, sore ini kita bahas tentang ic untuk jam digital, pendukung jam digital. Modul  RTC (Real Time Clock) menggunakan IC DS1307 mencatat Tanggal dan waktu (jam). RTC ini dapat digunakan pada Arduino atau ATMEGA 8/16/32 melalui komunikasi I2C.
Kita akan mencoba merancang Arduino dengan RTC. Lihat Schematic dibawah ini :
Source code
// Program: Date and time with RTC DS1302 module 
/  www.howrudi.com
// Load the virtuabotixRTC library 

#include <Wire.h>
#include "RTClib.h"

RTC_DS1307 RTC;

void setup () {
    Serial.begin(57600);
    Wire.begin();
    RTC.begin();

  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(__DATE__, __TIME__));
  }
}

void loop () {
    DateTime now = RTC.now();
    
    Serial.print(now.year(), DEC);
    Serial.print('/');
    Serial.print(now.month(), DEC);
    Serial.print('/');
    Serial.print(now.day(), DEC);
    Serial.print(' ');
    Serial.print(now.hour(), DEC);
    Serial.print(':');
    Serial.print(now.minute(), DEC);
    Serial.print(':');
    Serial.print(now.second(), DEC);
    Serial.println();
    
    Serial.print(" since midnight 1/1/1970 = ");
    Serial.print(now.unixtime());
    Serial.print("s = ");
    Serial.print(now.unixtime() / 86400L);
    Serial.println("d");
    
    // calculate a date which is 7 days and 30 seconds into the future
    DateTime future (now.unixtime() + 7 * 86400L + 30);
    
    Serial.print(" now + 7d + 30s: ");
    Serial.print(future.year(), DEC);
    Serial.print('/');
    Serial.print(future.month(), DEC);
    Serial.print('/');
    Serial.print(future.day(), DEC);
    Serial.print(' ');
    Serial.print(future.hour(), DEC);
    Serial.print(':');
    Serial.print(future.minute(), DEC);
    Serial.print(':');
    Serial.print(future.second(), DEC);
    Serial.println();
    
    Serial.println();
    delay(3000);
} 

Comments

Popular posts from this blog

Android 12 Developer Preview: Requirements, How to put in and more

  Hi-Jetniaga.com | Google has launched the primary Android 12 Developer Preview.  Here’s the whole lot you want to recognise approximately it, together with steps on the way to deployation it in your phone. oogle these days introduced its next-gen Android 12 running gadget, as a way to be released later this year.  The new running gadget will include numerous new functions, which intention to enhance the general overall performance and consumer experience.  Apart from the layout components, the agency is likewise introducing more than a few of  recent privateness functions, as a way to permit customers to govern how they’re tracked throughout sites.  You can test out the listing of the pinnacle five Android 12 functions right here.  Also Read – Twitter checking out Spaces for Android; in advance of March launch. The first developer preview for Android 12 is now available.  However, because of it being the primary developer preview take be aware t...

Do'a

Islam itu sehat, islam itu bersih, islam itu ketat, islam itu cinta damai…tapi zaman sekarang Cuma ngaku islam aja… Lanjut jay a…dibawah ini beberapa do’a- do’a, semoga bermanfaar….tetapi sebelum lanjut saya pingin berbagi tentang adzab-adzab berdo’a…OK ADAB BERDO’A Dalam berdo’a kepada Allas SWT, hendaklah dilakukan dengan adzabnya : 1. Menjahui yang diharmkan baik, makanan, minuman, atupun pakaian 2. dengan hati yang ikhlas 3. sangat baik jika dikerjakan setelah sholat 4. sebaiknya didahuli mengucapkan kalimat tahmid ( alhamdulillah ) shalawat dan salam atas Nabi Muhamad saw pada awal dan akhir do’a 5. khuyu dan tenang 6. dengan suara rendah dan berharap dengan sepenuh hari 7. mengulangi beberapa kalai dengan tidak berputus asa 8. menghadirkan arti kepada Allah SWT 9. jangan berdo’a untuk berbuat dosa 10. Jangan berkata “ Aku telah berdo’a tetapi belum dikabulkan oleh Allah SWT ) Nah,…sekarang kita mulai berdo’a..OK Doa’ Akan Tid...

Umum

Web_Professional_dengan_Photoshop_&_Dreamweaver2.zip Web_Professional_dengan_Photoshop_&_Dreamweaver1.zip Tutorial_Photoshop_Membuat_Teks_Reflektif.zip Tutorial_Hack_Password_Friendster_Fake_Login.zip Traffic-sakti.zip Tips_dan_Trik_Photoshop_Bab3.zip Tips_dan_Trik_Photoshop_Bab2.zip Tips_dan_Trik_Photoshop_Bab1_2.zip Tips_dan_Trik_Photoshop_Bab1_1.zip SPECIAL_EFFECTS_History_and_Techniques.zip