RTC 1307


hello everyone,

i have problem arduino nano , rtc 1307.
i use code:

#include <wire.h>
#include "rtclib.h"
rtc_ds1307 rtc;
 
 
void setup () {
    serial.begin(9600);
    wire.begin();
    rtc.begin();
  if (! rtc.isrunning()) {
    serial.println("rtc not running!");
    // following line sets rtc date & time sketch compiled
    rtc.adjust(datetime(__date__, __time__));
  }
}
void loop () {
    datetime = 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();
    delay(1000);
}

but when start serial monitor showed nothing. ideas? thanks  , sorry english

is serial monitor speed set 9600? speed mismatch problem.


Arduino Forum > Using Arduino > Project Guidance > RTC 1307


arduino

Comments

Popular posts from this blog

DHT11 Time out error using v0.4.1library

Sketch upload fails with Java error (___REMOVE___/bin/avrdude)!

Arduino Uno + KTY81/210 temperature sensor