Added some more projects and libraries.
This commit is contained in:
parent
f7151392ab
commit
1e1459fa50
94 changed files with 11904 additions and 0 deletions
27
DCF77setTime/DCF77setTime.ino
Normal file
27
DCF77setTime/DCF77setTime.ino
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#include <stdio.h>
|
||||
#include "DateTime.h"
|
||||
#include "RealTimeClock_DCF.h"
|
||||
#include "Wire.h"
|
||||
|
||||
DateTime dateTime;
|
||||
|
||||
void setup() {
|
||||
delay(1500);
|
||||
RTC_DCF.begin();
|
||||
RTC_DCF.enableDCF77Reception();
|
||||
RTC_DCF.getDateTime(&dateTime);
|
||||
Serial.begin(115200);
|
||||
printClock();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
delay(1000);
|
||||
RTC_DCF.getDateTime(&dateTime);
|
||||
printClock();
|
||||
}
|
||||
|
||||
void printClock(void) {
|
||||
char clockString[30];
|
||||
sprintf(clockString, "Es ist %02u:%02u:%02u am %02u.%02u.%02u", dateTime.getHour(), dateTime.getMinute(), dateTime.getSecond(), dateTime.getDay(), dateTime.getMonth(), dateTime.getYear());
|
||||
Serial.println(clockString);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue