[Input widgets]
Object Functions
Spinbox object.

Spinbox Properties.

Identifier:
- ID: Unique number that identifies the object.
- Name: User-definable name for the object. It can be used with 86HMI API.
Geometry:
- X: Object X coordinate.
- Y: Object Y coordinate.
- Width: Object width.
- Height: Object height.
Options:
- Type: Input style of Spinbox, which has a total of 4 types.
- Number of Digits: Number of digits in total, including decimal points.
- DecimalPoint: Set the number of decimal points for the value. For example, if DecimalPoint is 3, the value will be displayed to the 3rd decimal place.
- NumericLimit: NumberInput value limitation (No limit or positive integer only)
- TextFont: Choose from 6 default font styles. For font configuration instructions, please refer to Theme Management.
- Enable: Select the default state of the object, enable or disable.
- Order: Object order. It can adjust the object order by up/down, which can be viewed on the Object List.
API Functions
setSpinboxValue()
Description
Set Spinbox Value.
Syntax
void setSpinboxValue(lv_obj_t* id, double value);
void setSpinboxValue(char* name, double value);
Parameters
[in] id
Object ID.[in] name
Object Name.[in] value
Spinbox Value.
Return
None.
Example
#include "myhmi.h" void setup() { Hmi.begin(); // ... Hmi.setSpinboxValue(p1sp1, 100); } void loop() { // ... }
getSpinboxValue()
Description
Get Spinbox value.
Syntax
double getSpinboxValue(lv_obj_t* id);
double getSpinboxValue(char* name);
Parameters
[in] id
Object ID.[in] name
Object Name.
Return
Spinbox value.
Example
#include "myhmi.h" void setup() { Serial.begin(115200); while (!Serial); Hmi.begin(); // ... Serial.println(Hmi.getSpinboxValue(p1sp1)); } void loop() { // ... }
getSpinboxInteger()
Description
Get Spinbox integer value.
Syntax
int getSpinboxInteger(lv_obj_t* id);
int getSpinboxInteger(char* name);
Parameters
[in] id
Object ID.[in] name
Object Name.
Return
Spinbox integer value.
Example
#include "myhmi.h" void setup() { Serial.begin(115200); while (!Serial); Hmi.begin(); // ... Serial.println(Hmi.getSpinboxInteger(p1sp1)); } void loop() { // ... }
Please see the 86HMI Editor User Manual for more instructions on 86HMI widgets and API usage.