Start a new topic

rx comand

cara GUI

Sono nuovo in questo mondo, e ho bisogno di un aiuto.

provo a esplicativi, il mio problema.

devo acquistare visualizzazione nextion NX3224T024, e ho dovuto iniziare a studyng, i undertand molto.

Ho inserire una nuova pulsanti e ho capire come l'invio di un comando di CIP, quando una spinta del bottone, nextion inviare un mio CIP "00x01 Printh" e il LED accendere.

Ma ora ho un grosso problema, come si fa a ricevere il comando dal mio CIP a Nextion.

è necessario scrivere qualche comando sull'editor?

Vorrei cambiare il colore del bottone dopo la mia spinta, quando il mio CIP inviare il comando dopo il led girare in su.

mi scusi per il mio inglese

e grazie per una risposta


I apologize for my lack of languages.  The board is in English.


Inside the code section for a button Touch Press Event

"printh 01" 

will cause the Nextion to transmit one byte with the value (in hexadecimal) of 0x01 to your MCU

(MCU - micro controller unit)


Now you wish to change the button color.  Assuming button .objname is b0

Your MCU must send to the Nextion

   b0.bco=2016 followed by three bytes with value 0xFF (hex) or as a character 255 decimal ÿ


This could look something like

  Serial.print("b0.bco=2016")

  Serial.write(0xFF);

  Serial.write(0xFF);

  Serial.write(0xFF);

or like

  Serial.print("b0.bco=2016ÿÿÿ");


All commands going the Nextion must be followed by these three bytes to terminate the commands.


Colors are in 565 color format and not RGB

Red value from 0 to 255 is divided by 8 

Green value from 0 to 255 is divided by 4 

Blue value from 0 to 255 is divided by 8 

So the 565 color value would be ((r / 8) * 2048) + ((g / 4) * 32) + (b / 8)

Mostly you remember to write down the numbers to the colors you like.


The Nextion understands only a few colors (in uppercase)

RED,BLUE,GRAY,BLACK,WHITE,GREEN,BROWN,YELLOW

Found in Nextion Instruction Set towards the bottom of the page.


I did not understand what CIP was, I have guessed what you might be trying to ask.

I hope this has helped a little.  Please try to post in English in the future.


thank you patrick

 

your answer it was very clear, and now my MCU get and trasmit data, and my naxtion change the color of button.

but now i have a new question, i read the manual but is not clear.

where i can read the commands, because i would change the text of button, and in the future i would insert the tacometer or another analogic indicator.

i did search in nextion site, i dont read nothing.

if is possible i would the site or is possible you send at me the commands

 

another time thank you

In the Nextion Editor, on the right side, lower panel - is attribute section.

In the same manner as the b0.bco=2016 command example above, you can change many attributes.


Any attribute in Black is Change at design time, read-only at runtime.

Any attribute in Grey is enumerated, options by dropdown.  Again change at design, read-only at runtime.

Any attribute in Green is changed at design time AND changed at runtime.

Any attributes in bold green is change a design time AND changed at runtime AND auto-refreshes.

(auto-refresh does not require the ref command.  ie ref b0)


Much reading available

   https://www.itead.cc/wiki/Nextion_Instruction_Set

Tutorials

   https://www.itead.cc/blog/tag/nextion

FAQs

   http://support.iteadstudio.com/support/discussions/topics/11000002523

User Manual  (a work in progress)

   http://support.iteadstudio.com/support/discussions/topics/1000065323

another time thank you

 

i understud your explication, but when i write the comand like a:

 

b0.bco=63488 in this mode the button change your color on red, and that is clear and work very well

but when i write another command like a:

b0.txt=hello the text of button don't change why?

i don't understand

b0.txt="hello"

sorry but when i write B0.txt="hello" come out this message

Immagine.jpg


i try to write in this way "b0.txt=hello" my compiler accept this command but the nextion dosen't visualize nothing, you will apologize me but really i don't understand yet

for .txt attributes, the Nextion must receive b0.txt="hello"

If this is inside a function that is also using quotes the compiler may be pairing quote marks ".

This would cause the parameter to terminate at the equal sign =

perhaps, try "b0.txt=\"hello\""

- first outer quote " then b0.txt= then inner literal \" then string hello then inner literal \" and last outer quote "



I can see that you are using a Picaxe.

The correct way to write the expression is

("b0.txt=",34,"hello",34)

The Picaxe syntax is a little strange and does not accept ("b0.txt="hello"") but will accept ("b0.txt=",34,"hello",34) as 34 is the value for "


thank you guys you are bigger

 

now my sistem work very vell.

if i can, i would do a last question.

to use slide command, that command i will need

To read the value of slider h0

Serout nextion_rxd, nextion_baud_rate, ("print h0.val",$FF,$FF,$FF)

this will force the display to send the value of the slider. Immediattely after,

Serin c.1,nextion_baud_rate,w11

this will transfer the slider value into Picaxe word w11


thank you

 

also your last answer it was perfect.

now you are my teacher, and i have a new question, is possible trasmit at the nextion one value write inside the variable?

because per example if i need to visualize a temperature of probe, i send the signal at the variable, and the variable send the signal at the nextion, on this way the value goes to up and down without any command.

i try to write a lot commands, but without succes 

If I understand your question, you have a value inside a Picaxe variable that might be the result of reading a sensor and you want to send it to the Nextion!

Let say your sensor value is in b0 and you want to move the slider h0 value in consequence, the command would be:

Serout nextion_rxd, nextion_baud_rate, ("h0.val=",#b0,$FF,$FF,$FF)

is it what you have in mind?


hi guys good morning

 

i have made a lot of steps forword with my nextion, but i have 2 questions

how is the command to change the page from picaxe to nextion?

and more important, where do you discover all the command picacxe to nextion that you explain to me, if you tell me where i thank you very much

Login or Signup to post a comment