This page documents our Arduino library functions for updating controls on an interface panel.

Check out getting started building Arduino interfaces and processing serial commands with an Arduino for an introduction to custom user interfaces.

See updating controls from your Arduino for a walkthrough and the control reference for available controls and the methods they support.

The InterfacePanel class in the MegunoLink Pro Arduino Library provides a convenient set of methods for sending messages to MegunoLink’s Interface Panel to re-configure and request the property values of the objects shown. This library lets you send data and commands to controls on an interface panel to change property values.

Controls are identified by their Name property.

Methods

InterfacePanel(ChannelName — optional ) (constructor)
SetText(ControlName, Value)
SetText(ControlName, Value, DecimalPlaces)
SetProgress(ControlName, Value)
SetNumber(ControlName, Value)
SetNumber(ControlName, Value, DecimalPlaces)
SetListIndex(ControlName, Index)
SetListValue(ControlName, Value)
SetListName(ControlName, Name)
SetCheck(ControlName, Checked — optional)
ClearCheck(ControlName)
CallCommand(CommandName)
GetValue(ControlName, PropertyName)
HideControl(ControlName)
ShowControl(ControlName)
EnableControl(ControlName)
DisableControl(ControlName)
SetForeColor(ControlName,Color)
SetBackColor(ControlName,Color)
SetReadOnly(ControlName, True/False)
SetMinimum(ControlName, Value)
SetMaximum(ControlName, Value)
SetGaugeLabel(ControlName, LabelIndex, LabelText)

Detailed Descriptions

InterfacePanel(ChannelName — optional )

Constructs an InterfacePanel variable, with an optional ChannelName.

SetText(ControlName, Value)

Sets the text displayed in a control. Applies to: text box, dynamic label, button and progress bar.

SetText(ControlName, Value, DecimalPlaces)

Sets the text displayed in a control. Applies to: text box, dynamic label, button and progress bar.

SetProgress(ControlName, Value)

Sets the current value displayed by a progress bar control.

SetNumber(ControlName, Value)

Sets the number displayed in a numeric up/down, track-bar, gauge or other compatible numeric control.

SetNumber(ControlName, Value, DecimalPlaces)

Sets the number displayed in a numeric up/down, track-bar, gauge or other compatible numeric control.

SetListIndex(ControlName, Index)

Sets the index of the item selected in a value-list control. The first item in the list box is 0.

SetListValue(ControlName, Value)

Selects the item with the given value in a single-selection, value-list control. In a multi-selection value-list control, selects any items where a bitwise and between the item value and the new value is equal to the item value. This allows a list box to represent bit-flag variables.

SetListName(ControlName, Name)

Selects the item with the given name in a single-selection, value-list control.

SetCheck(ControlName, Checked — optional)

Sets the check-state of a check box or radio button control. If the optional Checked parameter is missing, the control is checked. Otherwise, if Checked is true, the control is checked; if false, the control is unchecked.

ClearCheck(ControlName)

Clears the check mark from a check box or radio button control.

CallCommand(CommandName)

Invokes a named command from the message library attached to the message processor. Typically the command returns a serial message.

GetValue(ControlName, PropertyName)

Returns the value of a serial message property for the named control. The format used for the message return is described in the Message Processor Reference.

ShowControl(ControlName)

Makes a previously hidden control visible. Applies to all controls supporting common control properties.

HideControl(ControlName)

Hides a control so it is no longer visible. Applies to all controls supporting common control properties.

EnableControl(ControlName)

Enables a control so it is accessible to the user. Applies to all controls supporting common control properties.

DisableControl(ControlName)

Disables a control so it is grayed out and not accessible to the user. Applies to all controls supporting common control properties.

SetForeColor(ControlName,Color)

Controls the foreground color of the interface element. Colors may be specified by named or as a six digit hexadecimal value. Hexadecimal values are specified as RRGGBB where RR, GG and BB are each two digit hexadecimal values specifying the strengths of the red, green and blue components of the color respectively. Applies to all controls supporting common control properties.

SetBackColor(ControlName,Color)

Controls the background color of the interface element. Colors may be specified by named or as a six digit hexadecimal value. Hexadecimal values are specified as RRGGBB where RR, GG and BB are each two digit hexadecimal values specifying the strengths of the red, green and blue components of the color respectively. Applies to all controls supporting common control properties.

SetReadOnly(ControlName,True/False)

Set the read-only property of text box and numeric up/down controls.

SetMinimum(ControlName,Value)

Set the minimum value allowed for numeric up/down, track-bar and progress bar controls.

SetMaximum(ControlName,Value)

Set the maximum value allowed for numeric up/down, track-bar and progress bar controls.

SetGaugeLabel(ControlName, LabelIndex, LabelText)

Allows you to adjust the text for one of the labels displayed on a gauge control. In the example below we are setting the 0th label in the collection for the panel called MyGauge to display the text “Max Speed Reached”.

Start typing and press Enter to search