BindGaugeSimple Class. More...
#include <BindGaugeSimple.hpp>
Public Member Functions | |
BindGaugeSimple (const char *cstr) | |
Constructor with a label parameter. | |
BindGaugeSimple () | |
Default constructor. | |
void | setlabel (const char *cstr) |
Set the label text. | |
uint16_t | getBytes (uint8_t *out) |
Serialize the gauge object into bytes. | |
Public Attributes | |
int16_t | x = 0 |
The x-coordinate position of the gauge on the screen. | |
int16_t | y = 0 |
The y-coordinate position of the gauge on the screen. | |
uint8_t | cmdId = 0 |
Command identifier to add or refresh the gauge. See the notes for possible cmdId values. | |
int16_t | dimSize = 200 |
The dimensions (size) of the gauge. | |
int16_t | minValue = 0 |
The minimum value for the gauge's value range. | |
int16_t | maxValue = 100 |
The maximum value for the gauge's value range. | |
int16_t | value = 0 |
The current value of the gauge. | |
uint8_t | style = 0 |
The style of the gauge (e.g., radial or linear). | |
bool | isSymmetrical = false |
Indicates whether the gauge is symmetrical or not. | |
int32_t | color |
The color of the gauge. | |
![]() | |
int16_t | tag |
BindGaugeSimple Class.
The BindGaugeSimple
class is a part of the Bind framework for Arduino, designed to create a simple gauge element that can be displayed and controlled on the BindCanvas Android app interface.
This class allows you to define the properties of a gauge, including its position, size, value range, current value, style, symmetry, color, and label. You can synchronize these properties with BindCanvas to provide visual gauge displays in your Arduino projects.
The gauge's properties can be customized by setting attributes such as the position (x and y coordinates), dimensions (size), minimum and maximum values for the gauge, current value, style (e.g., arc, horizontal, or vertical), whether it's symmetrical or not (center is zero), color, and label text.
To use the BindGaugeSimple
class effectively, you can create an instance, set its attributes, and call bind.sync(your_gauge)
to synchronize it with BindCanvas.
Example usage:
BindGaugeSimple::BindGaugeSimple | ( | const char * | cstr | ) |
Constructor with a label parameter.
Initializes a BindGaugeSimple
object with a custom label text.
cstr | A pointer to the label text. |
|
inline |
Default constructor.
Initializes a BindGaugeSimple
object with a default label ("Gauge").
|
virtual |
Serialize the gauge object into bytes.
This function serializes the gauge object into a byte array, allowing it to be sent and displayed on BindCanvas.
out | A pointer to the byte array where the serialized data will be stored. |
Reimplemented from BindView.
|
inline |
Set the label text.
Allows setting a custom label text for the gauge.
cstr | A pointer to the label text. |