Start a new topic

Count txt characters

I want to turn page only when my text contains two characters but I have no idea how to do it, can anyone tell me how?

read the Nextion Instruction Set ...

Done and I have an if it looks to.txt size but it does not

Reading of the Nextion Instruction May require more than random selection.

More than one command of Nextion Instruction Set may apply

Combinations of more than one May be necessary.

When you can begin to effectively describe EXACTLY what you want done

and how you COULD go about achieving it - USING the AVAILABLE commands

- then you can use this mental logic to program Nextion logic or MCU logic

Otherwise continue to try to EXACTINGLY describe what you are trying to do.

When it doesn't give the desired result - you left something out.



I want to "turn page" ...

  - change to another page? or rotate current page by 90° CCW?

when "my text"

 - what text?  Nextion and MCU needs to know WHICH text

contains "two characters"

 - not descriptive enough, WHICH two characters, or ANY two characters

Also what tools and resources are you using to try to accomplish

 - some tools can do, others will not be able to do

With no knowledge of what is available to use in solution

Which MCU is used?

What Programming Language used? 

Which compiler is used?

What library and supporting code is used?

What hardware is available to use towards the solution?

  - motor drivers, power sources, servos and type of ?

What has been tried already and what were the result?

I want to change to another page when my t0 have two numbers (enter the keyboard of nextion editor) and i like to do this from nextion editor too. I have to see how to do this...

so how do the numbers end up into t0?

Oh t0 have txt_maxl limited but i try to use strlen to know if these two numbers have been entered! Maybe...

See, the more you describe exactly what needs to be done,

   the more the solution is already in front of you.

Entire project is exercise in describing exactly to

   Nextion or MCU what it is that you want done

MCU will only ever do EXACTLY as told to do

 - result not as expected = missing steps

missing steps = missing thinking = unexpected results

Yes Patrick, you're right. Thanks for helping me or making me think twice about something that for me it hadnt other possibility
I guess... Thank you so much, patrick and gerry

There are always many many ways to achieve task in programming.

Best is always if you use your thinking on how to get from point A to point B

 - when you try to use someone else's method,

   you will mosly find it difficult to follow "their" train of thought at the time they wrote it.

 - trying to figure out someones train of thought from code is called debugging.

So best is yours

 use // at beginning of line to make comment and notes

In three weeks after you set it down

 even you will wonder what you were thinking at the time.

Login or Signup to post a comment