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