This library provides simplified functions for sending JSON commands to a STONE HMI and parsing data.
🚧 This Library and page is under construction.
Make sure to include libarary and initialize in your code with these commands:
#include "StoneHmiBridge.h"
StoneHmiBridge myHMI;
Please ensure that you replace the placeholder "mySerial" with the appropriate name of your serial setup in order to establish communication with the STONE HMI.
example function call:
myHMI.parseData(mySerial, cmd, data)
(this code will return both the cmd and data values)example function call:
myHMI.update_label(mySerial, "label1", "value", 100);
myHMI.update_label(mySerial, "label1", "text", "your text here");
example serial output:
ST<{"cmd_code":"set_text","type":"label","widget":"label1","text":"Hello, World!"}>ET
example function call:
update_mledit_text(mySerial, "MyWidget", "Example text");
example serial output:
ST<{"cmd_code":"set_text","type":"mledit","widget":"mledit1","text":"This is a multi-line text."}>ET
example function call:
update_graph(mySerial, "MyLineSeries", 42);
example serial output:
ST<{"cmd_code":"set_value","type":"line_series","widget":"lineSeries1","mode":"push","value":42}>ET
example function call:
update_graph_data(mySerial, "x_axis", "x_axis1", "0,1,2,3,4,5,6,7,8,9,10");
(can be x or y axis)
example function call:
update_graph_data(mySerial, "x_axis", "x_axis1", 0, 100)
(can be x or y axis)
example function call:
update_brightness(mySerial, 75);
example function call:
update_volume(mySerial, "set_vol", 20);
(sets volume to 20%)update_volume(mySerial, "set_vol_inc", 5);
(increases volume by 5%)update_volume(mySerial, "set_vol_dec", 5);
(decreases volume by 5%)update_volume(mySerial, "set_mute", true);
(mutes volume can be true or false)
example function call:update_radio_button(mySerial, "MyRadioButton", true);
(sets radio button state to true or false)example function call:
update_switch(mySerial, "MySwitch", true);
(sets switch state to true or false)example function call:
update_check_button(mySerial, "MyCheckButton", true);
(sets check button state to true or false)example function call:
update_progress_bar(mySerial, "set_max", "MyProgressBar", 100);
(set max value of progress bar)update_progress_bar(mySerial, "set_value", "MyProgressBar", 100);
(set current value of progress bar)example function call:
update_progress_circle(mySerial, "set_max", "MyProgressCircle", 100);
(set max value of progress circle)update_progress_circle(mySerial, "set_value", "MyProgressCircle", 100);
(set current value of progress circle)