Stuck on how to code an intervelometer

To print just that text without the actual numbers
t3.txt=“Photos: 0. Interval: 0.00 seconds. Exposure: 0.00 seconds”
t3.txt+=“\r It will take 0.00 seconds to complete this timelapse”
t3.txt+=“\r Played back at 30fps the resulting clip will be 0.00 seconds long”
That prints 3 lines on the text box

right, but obviously itll be like the code you posted b4 when the values are added

Now to add the numbers we would use a text variable and build up each line on it then put those one by one on the text box

hmm,
would it be easyer to just print the text from the arduino to the nextion display?

It would happen all at once in an event be a lot faster than using an out board micro serial back an forth. As I said the nextion can do it on board then just send out a simple command to an outside micro to do something or use its own GPIO ports to do it. Its good to learn how to use the nextion commands my inverter remote started on a AVR with lots of code (1000 lines) then I found out how to use the nextion code now it all on the nextion I even worked out how to do xmodem crc with the nextion code.

alright ill take your workd for it.
for the secon line “it will take ___ seconds to complete” that value involved me needing to multiply the interval with the number of photos. so i was thinking could i do something like covx hInt.val,va1.txt,0,0 covxhPhN.val,va2.txt,0,0 va1.txt*=va2.txt

I open the editor (have it open now) and use the debug to test out code with a button and text box , sliders , variables , number box as a test project it then tells me if I have errors and gives some hints in the error which helped me I also have the command reference up and look through it it took some time but I got there I still do the same every time I work on a project too hard to remember all the commands.

yea, the problem with the output box is its just telling me invalid variable opperation when im trying to multiply the photo number variable with the interval variable but im not quite sure how to go around this

You first assign the photo number to the number variable then multiply the number variable by the interval value
va1.val=h0.val
va1.val*=h1.val
now va1.val is the number you want and your not changing the slider value

Later have a look at my post on the reparse mode this is where you take control of the nextion serial.

so should va1 be a string or a number?

It would be a number as the slider values are numbers.

:+1: ill test it now

Then you use covx to change the variable to text and put it on a text box

A fun thing to learn is how to do animation on the nextion

2022-07-24 19_50_00-Nextion Editor
t3.txt=“////////////////////////////////////////////”
t3.txt+=“\rPhotos: "
covx hPhN.val,va1.txt,0,0
t3.txt+=va1.txt
t3.txt+=” Interval: "
covx hInt.val,va2.txt,0,0
t3.txt+=va2.txt
t3.txt+=" seconds. Exposure: "
covx hExp.val,va3.txt,0,0
t3.txt+=va3.txt
t3.txt+=" seconds. "
t3.txt+=“\rIt will take "
va0.val=hPhN.val
va0.val*=hInt.val
covx va0.val,va4.txt,0,0
t3.txt+=va4.txt
t3.txt+=” seconds to complete this timelapse"
t3.txt+=“\rPlayed back at 30fps the resulting clip will be "
covx va1.txt,va0.val,0,0
va0.val/=30
covx va0.val,va1.txt,0,0
t3.txt+=va1.txt
t3.txt+=” seconds long"
t3.txt+=“\r////////////////////////////////////////////”

Success!! i would have taken atleast another month to figure this out if it wasnt for you.
although the font is to big and cuts of and i dont really wanna wrap so how do you make the font smaller? but that doesnt matter same with decimals not being shown but not sure how viable that is.
one other problem i have is on the main slider i cant chance the values evenly, like it goes of by 21 but thats probably do to the slider values being 0-5000 and the width of it. are there ant ways to get it to slide by 10? or am i gonna have to change the width to get it to 20?
edit: just changed the width of the slider so it goes up by 20but in the degug screen it went up by 20 once (ie the sliders value was 20) than for the rest of the way went up by 21

You go to the fonts and add a new font + set its size and in the text box setting you chose that font number.

the problem is the smallest i can go is 16

Had not noticed that before try using different fonts when you generate one some are smaller. Times new roman is small

Also what nextion are you using then I can set the same

some of my early animation Animation 4 - YouTube

Note the straight ones are sliders.

Look at the number key board example that way you could just type the numbers into a number box not needing sliders.

i am using a NX483K035_011
SLSO DONT SUPPOSE YOU HAVE ANY FONT RECOMENDATIONS?
caps soz
didnt relise you did recomend a font lmao

NX483K035 or is it NX4832K035 ?

nx4832
forgot to read the 2