Nextion

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
eeEn_4618901
Level 4
Level 4
5 likes given First like received First like given

I want to get information from the slider on the touch nextion screen to psoc. I connected Nextion with UART to PSoC.

For example, if the slider value is 25%, how can I transfer it to PSoC?

0 Likes
1 Solution
EvPa_264126
Level 7
Level 7
500 replies posted 250 replies posted 100 likes received

https://community.cypress.com/message/187211#187211

This thread has an example of working with NEXTION.

Working with a slicer - read / write.

I hope this helps a little.

View solution in original post

7 Replies
EvPa_264126
Level 7
Level 7
500 replies posted 250 replies posted 100 likes received

https://community.cypress.com/message/187211#187211

This thread has an example of working with NEXTION.

Working with a slicer - read / write.

I hope this helps a little.

Dear Evgeniy,

which program is read?

I want to read the slider (h0) percentage from the Nextion.

How should I use which command?

???

void readNum(void)

{

   //char Str[12]  = "";  // Строка для сборки

   sprintf(Str,"xstr 0,30,200,20,0,BLACK,WHITE,0,0,1,\x22 Data= %d  \x22\xFF\xFF\xFF",received[1]);

   NEXTION_UART_PutString(Str);   //

}

or

void processMessage(unsigned char Length)  

  switch (received[0])

  {

  case 0x65: { Touch_event(); break;}; // 

      case 0x71: { readNum(); break;}; //  

   

      default: {

    NEXTION_UART_PutChar(Length); // сообщаем о не поддерживаемой функции

           };

    

   

    }; 

}//...................................

0 Likes

This version of the program does not read the value of the slider, but only informs about pressing.

I no longer remember the algorithm of actions ((

It seems so:

1.We are waiting for messages from NEXTION (CY_ISR (dataInRx_isr) flag Message sets = 2)

   when any component is pressed, NEXTION will display a message ...

   e.g. 6500 0400 FFFF FF

  First byte of message 0X65 Touch event return data   it will be handled by processMessage ()

   ---> case 0x65: {Touch_event (); break;};

further void Touch_event (void) will simply inform -> "Slider pressed"

If your slider has the name n0, then to read the slider you need to create the command NEXTION_UART_PutString ("get n0.val \ xFF \ xFF \ xFF");}

0 Likes

Dear Evgeniy,

So what should I do to read?

0 Likes

YOU said the display and PSoC are connected. what board do you use?

Can you provide your test project?

The very first step is to connect to NEXTION in a convenient way and see the result of pressing the slider.

For example CY8CKIT-059 PSoC 5LP has a USB-> UART_TTL converter (P12.7 = Tx P12.6 = Rx) like here (message 13)

0 Likes

Приветсьвую народ...помогите как подключится psoc059 в nextion display?????? help please

0 Likes

Dear my friend, How are you? hope all fine... am new in psoc and that form i have no idea what are people talking about..) sorry bothering you.. i want to run psoc 059 with nextion touch screen display ..any chance how to connect which buttons and how to create project i want to learn run as beginner..here is too much words which i dont understand any chance help me on this issue??? I really aopreciated if no chance i understand no one whants to waste time like to teach like me 🙂 if you wish i really will be happy ...) 

0 Likes