Start a new topic

if statement

Hi, I want an if statement of information. There is the possibility to enter AND and OR conditions in the display programming?

Salve, volevo capire se l'istruzione if consente di immettere AND e OR condizioni
no, no [AND OR XOR], but nested IF statements can do the same ...

 


1 person likes this

Nested "IF" statements are a pain in the ass, but they can do the very same.


Nidificate "IF" dichiarazioni sono una spina nel fianco, ma possono fare lo stesso.

As per the Nextion Instruction Set that no on reads

Simplex not complex compares == != >= > < <=


Nextion is mere Cortex M0 on Basic model and Cortex M3 on Enhanced

@Patrick Martin: I think that it should be stated in a more clear manner that the Nextion firmware interprets the user code more or less at runtime (based on a limited instruction set as documented) and does not really compile it as if it were Arduino C/C++ code. After reading through hundreds of forum posts here, I got the impression that this is one of the biggest misunderstandings happening to Nextion novices.

Super Great Point.


But how many times have I already posted that the TFT is a massive lookup table carrying the current firmware and it is records not objects.  None of it gets read, and then people come in calling it widgets and not components.  Using "Build" in the button caption wasn't gotten - so the button reads "Compile".


I am going to slam Arduino right now - because they push a plug in your wires and you are ready to go.  Yes, they do link to the 1479 page MCU document, but they don't push their users to read them.  Then they come with little or no understanding because they have never read their own MCU docs.  Arduino has promoted a cut copy and paste world that has resulted in a dangerous scenario.  Their users are being shielded (pun intended) away from understandings.


But Arduino represents maybe max 30 MCU types of 1000s being used with Nextion.  We don't hear the same from PIC or STM so much, because reading and understanding is an expected part of their culture.  ARM clearly told a user he need not be worried about "this issue" and strongly recommended his next action was to "put on a huge pot of tea, and start reading".


I can almost build a TFT file by hand, so I know what I am talking about.  But I know I have mentioned this interpreted nature and record structure not objects so many times already.  Saying again, doesn't sink in either.


But it isn't just the Arduino group, it is the desktop/server/mobile programmers as well (my crowd).  Coming in with a background of such high compute power and not accepting that this is just a small 8K sram and 64K flash MCU with a 4-32MB flash chip.  The expectations that an MCU chip acts the same as a CPU is just the wrong perspective.


Until the for and while commands was added, it was just a few text based shortcuts (commands).  It was more understood as not a programming language, but a few shortcut commands.  Now it is still NOT a programming language, but order them ("in a programming like fashion") and we can achieve some really neat things.  The old school DOS crowd that knows the ins and outs of sequential processing - well this works for the sequential single threaded nature of the MCU and Nextion Logic.


For the rest of the MCU embedded world, they never came in with any other expectations for it to be something it wasn't.  And their background was completely aligned with the embedded single threaded sequential nature of their MCUs.  We rarely hear from them except for some of their end result products they created with the Nextions

Login or Signup to post a comment