Nextion + Arduino Uno - NUMBER problem

Hello.

My project is very simple. I have a MAX6675 termocouple an arduino Uno and a Nextion display. I want it to show the values every second on the display, but after uploading the code to the display and arduino Uno it doesnt update the number. Any ideas why please? I find the tutorials confusing... Many thanks


#include <Nextion.h> 
#include <max6675.h> // max6675.h file is part of the library that you should download from Robojax.com

int soPin = 4;// SO=Serial Out
int csPin = 5;// CS = chip select CS pin
int sckPin = 6;// SCK = Serial Clock pin
MAX6675 Module(sckPin, csPin, soPin);// create instance object of MAX6675

// Definovať Nextion objekty (page ID , komponent ID, objname)
NexText t1 = NexText(0, 4, "t1");
NexWaveform s0 = NexWaveform(1, 0, "s0");

void setup() {

          
  Serial.begin(9600);// initialize serial monitor with 9600 baud
  Serial.println("MAX6675"); 

}

void loop() {
  // basic readout test, just print the current temp
   Serial.println(Module.readCelsius());
   delay(1000);
   n0.addValue(0,Module.readCelsius());
}

@nicolitetechnologies you posted in the place that people are supposed to post tutorials for beginners. This is not a tutorial but a question about your project so I have moved it here.

Do you get the right numbers printed out to the serial monitor?

I don't know the exact content of the lib, but at the first view I wonder about this line:

n0.addValue(0, Module.readCelsius());

Where does "n0" come from? Where is it declared, because I don't find it.

EDIT: I think, you want to speak with an object of the class NexWaveform. You declared it as "s0" so you have to write that instead of "n0". And: The "addValue"-function needs uint_8-type for the second argument. The readCelsius-function delivers float-type. Maybe, that causes the problem.
But I can only speculate, because I never worked with the libs...

how is the screen connected to the UNO?
don't you need a nexInit(); ?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.