A new video guide for NEXTION displays is being created.
I invite you to Youtube:
Playlist
Cool? Ranking DIY
Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tam| TOPIC | Arduino | LCD |
| INTRODUCTION | ||
| BUTTON - 1 | ||
| BUTTON - 2 | ||
| TEXT - 1 | ||
| TEXT - 2 | ||
| System init | ||
| NUMBER + TIMER | NexTimer, recvRetNumber, NexTouch, attachPop | number, timer, get, printh, if-else, font |
| TIMER + MENU | - BUTTON
- TEXT - TIMER - operator if - zmienne systemowe SYS0, SYS1 - array component b[id] | |
| NUMBER | - biblioteka SODAQ_BMP085
- setValue - NexTouch - obiekt NexNumber | - pole number
- pole text |
| ZMIENNE SYSTEMOWE | - getValue
- setValue - setText - sendCommand - recvRetNumber - obiekt NexVariable - NexText object | - DP system variable - NUMBER field - TEXT field - get command - page command |
| SYSTEM VARIABLES DIM | - system variable dim - timer - NUMBER element | |
| SLIDER | - NexNumber - NexSlider - gestureValue () - setValue () - atachPop () | - SLIDER item - NUMBER element - send event |
| PROGRESS BAR | -NexProgressBar - setValue () | - progress bar - timer - numeric field - error codes |
| CROP | ||
| HOTSPOT | - HOTSPOT - picq - tsw - xp - number | |
| PICTURE | - PICTURE
- TIMER - SYS VARIABLES - BUTTON - VIS | |
| GLOBAL VS LOCAL | - nexNumber
- getValue - setValue | - NUMBER
- BUTTON - VSCOPE GLOBAL LOCAL |
| FLOAT ds18b20 | - nexText
- setText - getText - memset - toCharArray - float to String - toFloat - DS18b20 - DallasTemperature | - NUMBER
- TEXT - PICTURE |
| FLOAT b | - user variables
- cov - number - button - text | |
| SLEEP | - sendCommand | - sleep
- ussp - thsp - thup - dim - keyboard - number - text - button |
| GOSUB DROP-DOWN MENU (live) | ||
| TAB MENU | ||
| PYTANIA ODPOWIEDZI MEMORY SIZE #23 (live) | Apetyt na ram obiektów nextion | |
| Protect Page #24 | - page
- click - vis - timer - variable - button element - txt element - numeric keyboard | |
| PYTANIA ODPOWIEDZI #25 (live) | - dsbutton
- debuger | |
| WAVEFORM LIS3MDL #26 | - waveform | - nexwaveform |
bt0.val=1
bt1.val=1
bt2.val=1
bt2.val=1
Quote:I do not know exactly whether it is for LCD or arduino with LCD.how to send commands with one button
kaino wrote:Thank you for the answers, is it possible to call such a function by entering the page, e.g. page 1
Already translators, I would like the display to start with some informational page (welcome page)
and after going to the next page it automatically turned on two relays, but that they were all the time high until the knock, I will not turn off the power
page 4printh 65 04 02 00 ff ff ff
page 0ekrzychoooo wrote:Hello
One command is unlikely to succeed. There is a trick that can be used:
create a Hotspot, e.g. m0 with the size of 2x2px and the code in it
bt0.val=1 bt1.val=1 bt2.val=1 bt2.val=1
And with arduino send a click code to click m0.0
In the film Link I showed how to use Hotspot in an unusual way
Quote:I do not know exactly whether it is for LCD or arduino with LCD.how to send commands with one button
ekrzychoooo wrote:It's hard to say something without seeing the code.
Can you paste the HMI file here as an attachment to a post?
Added after 14 [minutes]:
There is a new episode.
How to protect access to the site with a password
Quote:pinMode (213, OUTPUT);
Quote:sendCommand ("bt0.val- = 1");
Quote:sendCommand ("bt0.val + = 1");
Quote:if (dual_state) {digitalWrite (S1, LOW);} else {digitalWrite (S1, HIGH);}
ekrzychoooo wrote:you have the bt0PopCallback function implemented at the end of the code and you use it in setup.
Make a declaration of this function before setup
Code: C / C++Log in, to see the code
ekrzychoooo wrote:In fact, it has no right to work.
analyze this passage
Code: C / C++Log in, to see the code
button_pin3 is probably always on HIGH, so you have bt0.val permanently on 0
try this code
Code: C / C++Log in, to see the code
ekrzychoooo wrote:In the display for the bt0 button in the "Touch release Event" "Send command ID" must be selected.
If you have it, I don't know what could be either.
kaino wrote:sendCommand ("s2.bt0.en = 1");
sendCommand ("s2.bt1.en = 1");
kaino wrote:sendCommand ("s2.bt0.en = 0");
sendCommand ("s2.bt1.en = 0");
ekrzychoooo wrote:kaino wrote:sendCommand ("s2.bt0.en = 1");
sendCommand ("s2.bt1.en = 1");
kaino wrote:sendCommand ("s2.bt0.en = 0");
sendCommand ("s2.bt1.en = 0");
What are these bt0 and bt1 elements?
Whether bt0 and bt1 definitely have an attribute en
Attach the HMI file to the post
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]