Start a new topic

Nextion with Arduino PID controller

I have a 3.5" nextion HMI and Arduino mega, my project is to make PID temperature controller. I have made set value and current value of temperature in HMI. My question is how to get n0 (set value) in arduino and compare it with current temperature value and operate a relay.

Please help me out for the Float values how to use it and display it on Nextion.

I am new one for Nextion, please help.

Maybe the CompNumber example from the examples folder

I have tried but cant get decimal values

In arduino i have assign one integer variable int a;

int a =n0.val; 

but it not work.

Not the way the Arduino CompNumber example had it ?

 .. maybe review the code?


But my question is in this it is taking integer value, if i want to take float value like 30.4, then how to take it.

There has to be at least 80 threads on here maybe 120 that ask the same.

So you have two Component choices - Text or Number

A Variable component has .sta of Number or String

Instruction Set has a limited section on choices.  like cov command

But your question is also about how to code Arduino

and is not the resource to learn about the Arduino code side.

Nextion is integer based (as most MCUs are). there is no natural float.

int is integer, n0.val is 32 bit signed integer.

So when you want something like fixed digit decimal

  that is a composite - three parts:

    - whole integer portion

    - decimal point

    - fractional portion

Login or Signup to post a comment