Numbers from external keypad to nextion display via arduino?

Hi

I'm trying to build arduino based rotary table using Nextion Display and 4x4matrix keypad.
I use external keypad because it's much better to operate with.

But i ran into problem when trying to input data.
Let's say i want to input number "456" to nextion display text input field. When i send 4 it will display 4 and when i send 5 it will delete 4 and display 5 etc.

Then i thought that maybe i could use similar approach as nextion button keypad code uses. Basically "textfield=textfield"+some_number". But it's doesn't seem to work when this command is sent to nextion via serial.

  Serial2.print(F("t15.txt="));
  Serial2.print(F("\"t15.txt+\""));
  Serial2.print(key);
  Serial2.print(F("\""));
  Serial2.write(0xff);
  Serial2.write(0xff);
  Serial2.write(0xff);

Anyone have any ideas how to solve this problem? :slight_smile:

This code chunk looks like it will display (I set int key = 7:

t15.txt="t15.txt+"7"ÿÿÿ

What are you expecting?

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