| Documentation For Arduino users

- Main Page
- Related Pages
- Modules
- Classes
- Files
- Examples

- File List
- File Members

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