Documentation
For Arduino users
CompRtc.ino
How to Use
This example shows that in nextion screen displays the current read the RTC time and show how to use the API.
Author
huangxiaoming (email:xiaom.nosp@m.ing..nosp@m.huang.nosp@m.@ite.nosp@m.ad.cc)
Date
2016/12/8
#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);
}