Advertisement
dianartanto

modifikasiprogramnow

Jun 22nd, 2015
604
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.66 KB | None | 0 0
  1. #include <Wire.h>
  2. #include "DS3231.h"
  3. char weekDay[][4] = {"Min","Sen","Sel","Rab","Kam","Jum","Sab"};
  4. DS3231 RTC;
  5. void setup () {
  6.     Serial.begin(9600); Wire.begin(); RTC.begin();}
  7. void loop () {
  8.     DateTime now = RTC.now();
  9.     Serial.print(now.year(), DEC);
  10.     Serial.print('/');
  11.     Serial.print(now.month(), DEC);
  12.     Serial.print('/');
  13.     Serial.print(now.date(), DEC);
  14.     Serial.print(' ');
  15.     Serial.print(now.hour(), DEC);
  16.     Serial.print(':');
  17.     Serial.print(now.minute(), DEC);
  18.     Serial.print(':');
  19.     Serial.print(now.second(), DEC);
  20.     Serial.print(' ');
  21.     Serial.println(weekDay[now.dayOfWeek()]);
  22.     delay(1000);}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement