-
Notifications
You must be signed in to change notification settings - Fork 4
Server API
Up to date as of version 1.5.3
A new feature is a server API, so that you can make a program yourself, that can use the features of ArduLED.
The server settings window is really just a console, where you can start and stop the server. As well as making the server start by it self on startup of ArduLED. The IP address can also be changed if desired, however the default should work in most cases.
With this new API, a test program have been added (under Source Code) where you can manually send commands to ArduLED, just so you can se how it works, and so that you have a sample of how to connect to it in your own program.
There is a preset number of commands to choose from, wich are listed here:
Command | Function |
---|---|
GETTOTALLEDCOUNT() | Gets the current total LED count in the currently send setup |
GETSERVERNAME() | Gets the name of the server |
FADECOLOR(bool FromZero, int FromID, int ToID, int R, int G, int B, int FadeSpeed, int FadeFactor) |
bool FromZero: If the program is to first set the LEDs to RGB code 0 0 0, before sending the desired colors int FromID: From what Software ID to start from int ToID: To what Software ID to go to int R: The color code for Red (0-255) int G: The color code for Green (0-255) int B: The color code for Blue (0-255) int FadeSpeed: The speed in ms it take for each color jump (see the Fade Colors section for more info) int FadeFactor: The factor of how hard to make each color jump (the value 10 would be equal to a fade factor of 0.1) (see the Fade Colors section for more info) |
INDIVIDUALCOLOR(int Pin, int ID, int R, int G, int B) |
int Pin: The Pin on your Arduino that the LED string is connected to int ID: What Hardware ID to use int R: The color code for Red (0-255) int G: The color code for Green (0-255) int B: The color code for Blue (0-255) |
VISUALIZER(bool StartVisualizer, bool StopVisualizer, string ConfigName) |
bool StartVisualizer: Tells to start the visualizer bool StopVisualizer: Tells to stop the visualizer string ConfigName: The name of the .txt file to use as a visualizer configuration |
GETVISUALIZERCONFIGS() | Gets the name of all the current config files in the visualizer config folder. |
AMBILIGHT(bool StartAmbilight, bool StopAmbilight, bool ShowOrHideBlocks, bool AutosetOffsets, string ConfigName) |
bool StartAmbilight: Tells to start the ambilight bool StopAmbilight: Tells to stop the ambilight bool ShowOrHideBlocks: Shows or hides the blocks is set to true bool AutosetOffsets: Autosets offsets string ConfigName: The name of the .txt file to use as a ambilight configuration |
GETAMBILIGHTCONFIGS() | Gets the name of all the current config files in the ambilight config folder. |
ANIMATION(bool StartAnimation, bool StopAnimation, bool LoopState, string ConfigName |
bool StartAnimation: Tells to start the Animation bool StopAnimation: Tells to stop the Animation bool LoopState: Tells weather to loop the animation or not string ConfigName: The name of the .txt file to use as a Animation configuration |
GETANIMATIONCONFIGS() | Gets the name of all the current config files in the animations config folder. |
INSTRUCTIONS(bool StartInstructions, bool StopInstructions, bool LoopState, string ConfigName |
bool StartInstructions: Tells to start the Instructions bool StopInstructions: Tells to stop the Instructions bool LoopState: Tells weather to loop the Instructions or not string ConfigName: The name of the .txt file to use as a Instructions configuration |
GETINSTRUCTIONSCONFIGS() | Gets the name of all the current config files in the instructions config folder. |
CLICKBUTTON(string ButtonName, int ButtonID) |
string ButtonName: What button to press int ButtonID: If there are more than one button with this name, then the index can be selected here (however 0 is usually a normal value to use) |
SETTEXTCONTROL(string TextboxName, int TextboxID, string Text) |
string TextboxName: What textbox to edit int TextboxID: If there are more than one textbox with this name, then the index can be selected here (however 0 is usually a normal value to use) string Text: The string to put into the text field |
SETTACKBARCONTROL(string TrackbarName, int TrackbarID, int Value) |
string TrackbarName: What trackbar to edit int TrackbarID: If there are more than one trackbar with this name, then the index can be selected here (however 0 is usually a normal value to use) int Value: What value to set the trackbar to |
SETNUMERICCONTROL(string NumericUpDownName, int NumericUpDownID, int Value) |
string NumericUpDownName: What NumericUpDown to edit int NumericUpDownID: If there are more than one NumericUpDown with this name, then the index can be selected here (however 0 is usually a normal value to use) int Value: What value to set the NumericUpDown to |
SETCOMBOBOXINDEXCONTROL(string ComboBoxName, int ComboBoxID, int Index) |
string ComboBoxName: What ComboBox to edit int ComboBoxID: If there are more than one ComboBox with this name, then the index can be selected here (however 0 is usually a normal value to use) int Index: What index to set the combobox to |
SETCHECKBOXCONTROL(string CheckboxName, int CheckBoxID, int Index) |
string CheckboxName: What Checkbox to edit int CheckBoxID: If there are more than one Checkbox with this name, then the index can be selected here (however 0 is usually a normal value to use) int Index: What index to set the Checkbox to |
GETCOMBOBOXLIST(string CheckboxName, int CheckBoxID) |
string CheckboxName: What Checkbox to edit int CheckBoxID: If there are more than one Checkbox with this name, then the index can be selected here (however 0 is usually a normal value to use) |
GETTRACKBARVALUE(string TrackbarName, int TrackbarNameID) |
string TrackbarName: What Trackbar to edit int TrackbarID: If there are more than one Trackbar with this name, then the index can be selected here (however 0 is usually a normal value to use) |
GETCHECKBOXSTATE(string CheckBoxName, int CheckBoxNameID) |
string CheckBoxName: What CheckBox to edit int CheckBoxID: If there are more than one CheckBox with this name, then the index can be selected here (however 0 is usually a normal value to use) |
As well as some return codes (These are by default commented out, can be found under ServerAPISection.cs):
Return code | Function |
---|---|
G | Good, input, executing command |
U | Unknown command |
B | Error in input |
Kristian Skov Johansen 2018