Skip to content

This library provides simplified functions for sending JSON commands to a STONE HMI and parsing data.

License

Notifications You must be signed in to change notification settings

JoshMH-91/STONE-HMI-Bridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 

Repository files navigation

Stone-HMI-Bridge-Library

This library provides simplified functions for sending JSON commands to a STONE HMI and parsing data.

🚧 This Library and page is under construction.

📚 Library Functions currenlty supported

These functions only return the JSON string you must send them through a serial print command to your HMI.

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.

• 🖥️ Parse incoming command and data

  example function call:
myHMI.parseData(mySerial, cmd, data) (this code will return both the cmd and data values)

• 🏷️ Update Label as value or text

  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

• 📜 Update Multi-line text

  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

• 📈 Update Graph by pushing data

  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

• 📈 Update Graph Data

  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)

• 📈 Update Graph Range

  example function call:
update_graph_data(mySerial, "x_axis", "x_axis1", 0, 100) (can be x or y axis)

• 💡 Update Screen Brightness

  example function call:
update_brightness(mySerial, 75);

• 🔊 Update Volume

  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)

• 🔘 Update Radio Button

  example function call:
update_radio_button(mySerial, "MyRadioButton", true); (sets radio button state to true or false)

• 🎚️ Update Switch

  example function call:
update_switch(mySerial, "MySwitch", true); (sets switch state to true or false)

• ✅ Update Check Button

  example function call:
update_check_button(mySerial, "MyCheckButton", true); (sets check button state to true or false)

• ➖ Update Progress Bar

  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)

• 🕛 Update Progress Circle

  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)


Buy Me A Coffee

About

This library provides simplified functions for sending JSON commands to a STONE HMI and parsing data.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages