DS1307 RTC How to check

preview_player
Показать описание
DS1307 Real Time Clock

Рекомендации по теме
Комментарии
Автор

#include <Time.h>
#include <DS1307RTC.h>

void setup() {

TimeElements te;
te.Second = 0;
te.Minute = 53;
te.Hour = 12;
te.Day = 16;
te.Month = 2;
te.Year = 2016 - 1970;
time_t timeVal = makeTime(te);
RTC.set(timeVal);
setTime(timeVal);
}

void loop()
{
digitalClockDisplay();
delay(1000);
}

void digitalClockDisplay() {
Serial.print(hour());
printDigits(minute());
printDigits(second());
Serial.print(" ");
Serial.print(day());
Serial.print(" ");
Serial.print(month());
Serial.print(" ");
Serial.print(year());
Serial.println();
}

void printDigits(int digits) {
//":"
Serial.print(":");
if (digits < 10)
Serial.print('0');
Serial.print(digits);
}

ArduinoAtmega
Автор

Sorry, if the link to google drive is inactive. Google disk has been buggy lately. I get comments recently about bad links and try to update them. If the link doesn't work, please let me know in the comments, I will replace it. Thanks you. And "Thank you" Google Drive for stability.

ArduinoAtmega
Автор

SDA/Analog pin 4 SCL/Analog pin 5 of the Arduino Nano board

floydrose
Автор

OLY SEND A MESSAGE IS SHOWN IN SERIAL MONITOR

shikari
Автор

Sorry, if the link to google drive is inactive. Google disk has been buggy lately. I get comments recently about bad links and try to update them. If the link doesn't work, please let me know in the comments, I will replace it. Thanks you. And "Thank you" Google Drive for stability.

ArduinoAtmega