Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Wire.h>
- #include "DS3231.h"
- char weekDay[][4] = {"Min","Sen","Sel","Rab","Kam","Jum","Sab"};
- DS3231 RTC;
- void setup () {
- Serial.begin(9600); Wire.begin(); RTC.begin();}
- void loop () {
- DateTime now = RTC.now();
- Serial.print(now.year(), DEC);
- Serial.print('/');
- Serial.print(now.month(), DEC);
- Serial.print('/');
- Serial.print(now.date(), DEC);
- Serial.print(' ');
- Serial.print(now.hour(), DEC);
- Serial.print(':');
- Serial.print(now.minute(), DEC);
- Serial.print(':');
- Serial.print(now.second(), DEC);
- Serial.print(' ');
- Serial.println(weekDay[now.dayOfWeek()]);
- delay(1000);}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement