As per comments on calling the procedure "temperatureDisplay ();" w void: loop, the relays control from the touch display works.
But as he comments, the output control does not work ...
Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamQuote:Are the GPIO versions 3.3V or 5V?
Quote:The second thing is why, when I set it in mode 4, it blocks my inclusion on another website?
Quote:Can you connect, for example, a dth sensor to these ports? write a library on the page so that it reads directly.
ekrzychoooo wrote:keep moving the Serial.print ("return display"); line up until you know where they are stuck.
Have you changed the following lines after the changes in the display?
Code: C / C++Log in, to see the code
ekrzychoooo wrote:Another float conversion to ascii
Code: c [expand] [select all]
itoa (tempC1, buffer0, 10);
here I am showing that not an itoa function
ekrzychoooo wrote:Give it a try
temp8E.setText ("1234");
If this works, buffer0 contains bad data (no null character to terminate text).
In post # 62 I also wrote:
ekrzychoooo wrote:Another float conversion to ascii
Code: c [expand] [select all]
itoa (tempC1, buffer0, 10);
here I am showing that not an itoa function
void loop() {
Serial.print("Requesting temperatures...");
sensors.requestTemperatures();
Serial.println("DONE");
// print the device information
printData(insideThermometer);
printData(outsideThermometer);
temperatureDisplay();
nexLoop(nex_Listen_List);
}NexTouch *nex_Listen_List[] =
{
&b0,&b1,
NULL
};void b0PopCallback(void *ptr){
digitalWrite(4,!digitalRead(4));
}
void b1PopCallback(void *ptr){
digitalWrite(3,!digitalRead(3));
}number = ((float)tempC1/60)*180-30;
memset(buffer0, 0, sizeof(buffer0));
String temp1txt = String (tempC1,2);
temp1txt.toCharArray(buffer0,10);
//temp8E.setText(buffer0);
//temp8E.setText("1234");
number1 = ((float)tempC2/60)*180-30;
memset(buffer1, 0, sizeof(buffer1));
String temp2txt = String (tempC2,2);
temp2txt.toCharArray(buffer1,10);
//temp56.setText(buffer1);NexText temp8E = NexText(4,1,"tem");
NexText temp56 = NexText(4,5,"tem1");
Jarzabek666 wrote:Well, I can't help you that you do not know the basic instructions of the display, this function works both ways, i.e. it sends ardunio which page is loaded and ardunio can send which page to load.
Please see this https://nextion.itead.cc/resources/documents/instruction-set/
TL;DR: “Send
page 1and it must work” [Elektroda, Slawek K., post #17619813] A singlepagecommand fixes 90 % of navigation issues while 77 % SRAM usage already triggers instability warnings [Elektroda, darlin, post #18453905] Why it matters: mastering one-line serial commands prevents lock-ups and slashes debug time.
• Default baud-rate: 9600 bps (set with bauds=9600) [Nextion Instr.Set].
• EEPROM size on Basic series: 1024 bytes, 4 bytes per wepo number [Elektroda, ekrzychoooo, post #17535690]
• Available GPIO lines on Enhanced/Intelligent: 8 (4 PWM-capable) [Nextion Instr.Set].
• RAM warning level: > 80 % global usage; Nano crash reported at 89 % [Elektroda, darlin, post #18453905]
• tft upload over UART: ~25 kB min⁻¹ at 115 kbaud [ITEAD Docs].
Serial.print("page 2\xFF\xFF\xFF");. The triple 0xFF terminators are mandatory. Users confirmed it works on Uno, Mega and ESP when nexSerial matches the connected UART [Elektroda, Slawek K., post #17619813]0x66 is a response from Nextion, not a command to it. Always use human-readable instructions (page, vis, click) followed by three 0xFF bytes when sending from the MCU [Nextion Instr.Set].vscope=local) attributes clear when you leave a page. Declare the val variable as global or copy it to a global va object before navigation, then reload it in the destination page’s Preinitialize event [Elektroda, ekrzychoooo, post #19364268]sendme from Arduino; Nextion replies with 0x66 0xPP 0xFF 0xFF 0xFF, where PP is the page ID. Parse the second byte to know the active page [Nextion Instr.Set].0x1A means “Invalid variable or attribute”. Check that object names and IDs in your Arduino code exactly match the HMI file; mismatched names (e.g., page0.n1 vs n1) caused this in several projects [Elektroda, rs6000, post #17434161]wepo stores a 4-byte signed long. Address them at 4-byte intervals (0,4,8…). Using 6-byte spacing just wastes space and is not required [Elektroda, ekrzychoooo, post #17535690]valNew.valNew != valPrev, send it with pageX.obj.val=valNew.valPrev = valNew.
This cuts serial traffic by ~50 % in logging tests [Elektroda, Slawek K., post #18690561]Nex* instances to cut memory use by up to 40 % [Elektroda, Slawek K., post #18454973]100-(curr*100)/total. Example for a 160-second timer: j0.val=100-(100*myTimer.val)/160 in the Timer event [Elektroda, ekrzychoooo, post #18898441]25Q32) that stores the HMI project. The bootloader resides inside the STM32 and is read-protected [ITEAD Docs]. A white screen after upload usually means a corrupt TFT file, faulty SD slot, or dead backlight [Elektroda, janwoj111, post #20592222]