Start a new topic

Nextion Math constructs

Can someone please show some examples or reference to examples of the maths constructs in nextion

I get errors when I try to use normal brackets

For argument sake how do I calculate

y=a+ b*c/d

y= (a+b)/c

y= a+((100-b)*c)/d    where a, b, c, d are all global integer variables, or written integers in the equation


I realize the problems with integer maths that it is probably better to multiply first before a divide


 


You can do it Rod, have faith.


What is Order of Operations 

  - what gets done first if there was such an Order of Operation?


When written and calculated by hand

 - which do you do first, next, next and last


Nextion follows that "by hand" - "No order of Operation" method.

Set you equations up as such and all is fine.

So what you are saying is for y=(a+b)/c

y=a+b

y=y/c


or   for   y= a+((100-b)*c)/d

y=100-b

y=y*c

y=y/d

y=y+a




and because you now have the correct order

you can shorten the number of lines


y=a+b/c

y=100-b*c/d+a

Login or Signup to post a comment