Nextion User Manual
For Arduino developers
NexSlider.cpp
Go to the documentation of this file.
1 
15 #include "NexSlider.h"
16 
17 NexSlider::NexSlider(uint8_t pid, uint8_t cid, const char *name)
18  :NexTouch(pid, cid, name)
19 {
20 }
21 
22 bool NexSlider::getValue(uint32_t *number)
23 {
24  String cmd = String("get ");
25  cmd += getObjName();
26  cmd += ".val";
27  sendCommand(cmd.c_str());
28  return recvRetNumber(number);
29 }
30 
31 bool NexSlider::setValue(uint32_t number)
32 {
33  char buf[10] = {0};
34  String cmd;
35 
36  utoa(number, buf, 10);
37  cmd += getObjName();
38  cmd += ".val=";
39  cmd += buf;
40 
41  sendCommand(cmd.c_str());
42  return recvRetCommandFinished();
43 }
44 
bool setValue(uint32_t number)
Set the value of slider.
Definition: NexSlider.cpp:31
bool getValue(uint32_t *number)
Get the value of slider.
Definition: NexSlider.cpp:22
The definition of class NexSlider.
NexSlider(uint8_t pid, uint8_t cid, const char *name)
Constructor.
Definition: NexSlider.cpp:17
Father class of the components with touch events.
Definition: NexTouch.h:53