Nextion User Manual
For Arduino developers
NexButton.cpp
Go to the documentation of this file.
1 
16 #include "NexButton.h"
17 
18 NexButton::NexButton(uint8_t pid, uint8_t cid, const char *name)
19  :NexTouch(pid, cid, name)
20 {
21 }
22 
23 uint16_t NexButton::getText(char *buffer, uint16_t len)
24 {
25  String cmd;
26  cmd += "get ";
27  cmd += getObjName();
28  cmd += ".txt";
29  sendCommand(cmd.c_str());
30  return recvRetString(buffer,len);
31 }
32 
33 bool NexButton::setText(const char *buffer)
34 {
35  String cmd;
36  cmd += getObjName();
37  cmd += ".txt=\"";
38  cmd += buffer;
39  cmd += "\"";
40  sendCommand(cmd.c_str());
41  return recvRetCommandFinished();
42 }
43 
NexButton(uint8_t pid, uint8_t cid, const char *name)
Constructor.
Definition: NexButton.cpp:18
uint16_t getText(char *buffer, uint16_t len)
Get text attribute of component.
Definition: NexButton.cpp:23
The definition of class NexButton.
bool setText(const char *buffer)
Set text attribute of component.
Definition: NexButton.cpp:33
Father class of the components with touch events.
Definition: NexTouch.h:53