Unofficial Nextion/TJC User Forum

I am having issues setting RTC data into a string

I am waiting on my 10.1" Intelligent series screen to arrive. In the meantime, I am attempting to build my interface.

The problem that I am trying to solve is adding RTC data to t1.txt, for example, 4/18/2021 - 11:26:00. However only 4/18/2021 - shows in t1.txt. Do I need the screen to get RTC data? Or will the ide generate the RTC data from my computer?

I have one timer: tm0 and two variables: covRTC and timeString

my timer event consists of:

cov rtc1,timeString.txt,0
timeString.txt+="/"
cov rtc2,covRTC.txt,0
timeString.txt+=covRTC.txt
timeString.txt+="/"
cov rtc0,covRTC.txt,0
timeString.txt+=covRTC.txt
timeString.txt+="-"
cov rtc3,covRTC.txt,0
timeString.txt+=covRTC.txt
timeString.txt+=":"
cov rtc4,covRTC.txt,0
timeString.txt+=covRTC.txt
timeString.txt+=":"
cov rtc5,covRTC.txt,0
timeString.txt+=covRTC.txt
t1.txt=timeString.txt

I adjusted the xcen and the txt_maxl of textString. I also changed cov to covx. Everything seems to work as expected. Updated event code:

covx rtc1,timeString.txt,0,0
timeString.txt+="/"
covx rtc2,covRTC.txt,0,0
timeString.txt+=covRTC.txt
timeString.txt+="/"
covx rtc0,covRTC.txt,0,0
timeString.txt+=covRTC.txt
timeString.txt+="-"
covx rtc3,covRTC.txt,0,0
timeString.txt+=covRTC.txt
timeString.txt+=":"
covx rtc4,covRTC.txt,0,0
timeString.txt+=covRTC.txt
timeString.txt+=":"
covx rtc5,covRTC.txt,0,0
timeString.txt+=covRTC.txt
t1.txt=timeString.txt

have you watched this video??

1 Like

I’ve watched a bunch of cheap controls nextion videos. Good channel.


This forum is in no way affiliated with NEXTION®, ITEAD STUDIO®, TJC®, or anyone else really. All product names, logos, and brands are property of their respective owners. All company, product, and service names used in this website are for identification purposes only. Use of these names, logos, and brands does not imply endorsement from the respective rights holder(s).