CompRtc.ino
#include "Nextion.h"
NexText t0 = NexText(0,1,"t0");
NexRtc rtc;
uint32_t time[7] = {2016,11,25,12,34,50};
uint8_t time_buf[30] = {0};
void setup()
{
nexSerial.begin(115200);
rtc.write_rtc_time(time);
}
void loop()
{
rtc.read_rtc_time(time_buf,30);
t0.setText(time_buf);
delay(1000);
}
NexRtc
NexRtc component.
Definition: NexRtc.h:31
NexText::setText
bool setText(const char *buffer)
Set text attribute of component.
Definition: NexText.cpp:32
nexSerial
#define nexSerial
Define nexSerial for communicate with Nextion touch panel.
Definition: NexConfig.h:37
Nextion.h
The header file including all other header files provided by this library.
NexRtc::read_rtc_time
uint32_t read_rtc_time(char *time, uint32_t len)
read rtc time
Definition: NexRtc.cpp:166
NexText
NexText component.
Definition: NexText.h:30