Hi
I want to show temperature value (celsius) in Nextion gauge (Temp value between 0-120 celsius).
Is it possible? because i have using DS18B20 Digital temperature sensor.If yes,how to map the gauge value to sensor value.
I have using Nextion advanced 2.8" display and Arduino mega.
I have make one program for showing the potentio meter value (pressure value in bar) in Nextion gauge as well as digital.its working.
But in case of temperature value using DS18B20 temperature sensor i am confused..
If you edit the title, then you can change the section of this forum. I think it should be in the "Displays" section, unless it is just a question about map().
The Nextion Arduino library has many shortcomings. That is why there are so many alternatives, which also have shortcomings. The best option is to start here:
Then you have to find an example for a Gauge.
Perhaps it is something like this:
int t = 80;
Serial.print("z0.val=");
Serial.print(t);
Serial.print("\xFF\xFF\xFF");
Which values needs to be mapped to which values ?
The DallasTemperature library returns a floating point number, you can cast that to a integer and then use the map().
I have sending two data to Nextion Display one for Gauge (z0) and other one to digital (x0)...
digital value (x0) printing in Serial monitor as well as Nextion according to temperature variation.
But in case of Gauge value (map value) printing erratically in Nextion as well as serial monitor.
#i want to read temp range 40-120 degree Celsius #In serial monitor shows the value of present temperature-temp-34.56. #329-is initial position of needle in Nextion gauge and 569 is the last point of needle (max-range-120)
Gauge needle start to move once temperature reaches 40 upto 120 degree Celsius ,if the temp is out of max range, gauge needle will stop on max reading.