PCF8593 RTC examples
hello,
i looking examples of sketches pcf8593 real time clock.
there few libraries on web find , seem old version of arduino , can't them work. none have example sketches.
anyone have working sketch pcf8593?
roger
i looking examples of sketches pcf8593 real time clock.
there few libraries on web find , seem old version of arduino , can't them work. none have example sketches.
anyone have working sketch pcf8593?
roger
https://github.com/kbrowder/pcf85xx-arduino/blob/master/src/examples/pcf8593/pcf8593.cpp
code: [select]
/**
* \author kevin browder
* \copyright gnu public license.
**/
#include "pcf8593.h"
#include "../../pcf85xxrtc.h"
#include "arduino.h"
#include "stream.h"
#include <time.h>
void setup() {
serial.begin(9600);
serial.println("started");
pcf85xx::getdefaultrtc()->reset();
setsyncprovider( pcf85xx::getdefaulttime );
}
void loop() {
char str[256];
snprintf(str, 256, "%04u-%02u-%02ut%02u:%02u:%02u", year(), month(),
day(), hour(), minute(), second());
serial.println(str);
delay(5000);
}
Arduino Forum > Using Arduino > Project Guidance > PCF8593 RTC examples
arduino
Comments
Post a Comment