Skip to main content

Device OUTPUT Configuration

Define a device output descriptor (SPAD -> Device)

For defining an output descriptor the following command syntax is used:

0,OUTPUT,<DeviceIndex>,<Tag>,<Type>,<Inherits>[,<Option>=<Value>,...];

<DeviceIndex> is the numercial index the output should be used by SPAD when sending updates to the device (See LED / DISPLAY update ). For Led commonly the pin on the device can be used as <DeviceIndex>. This way no more internal processing needs to be done on the device.
The <DeviceIndex> should be unique per <Type>

<Tag> being the internal name SPAD.neXt should use for events bound to that output descriptor. <Tag>'s must be unique device wide. It's generally a good idea to give the <TAG> a prefix (e.g. L_ for led and D_ for Displays)

<Type> the type of the output descriptor
Currently there are two types of output descriptors supported:

LED an led that has either only a ON/OFF state or a multi color LED

DISPLAY any kind of display

<Inherits> is a list of base configurations the output shall use within SPAD.neXt. This decides about the events available for the output and the behaviour.

Device output LED​

A led is a simple output descriptor that always has at least the state ON or OFF

Available <Inherits> for led​

SPAD_LED a simple ON/OFF led

SPAD_LED_3COL a 3 color led predefined as Red,Green,Yellow

SPAD_LED_C a led with custom defined colors. The option COLORSET=<Colorset_Index> must be added to the command to inform SPAD.neXt about the available colors.

Available specific options​

DYNLABEL=1Enabled updates of the led-labeltext (UI_FACE=2) via events
UI_FACE=0A round led that changed fillcolor depending on it's state
UI_FACE=1A rectangular led that changes foreground-color depending on it's stateFOREGROUND=Red
UI_FACE=2A rectangular led that can change fore/background depending on it's state

FOREGROUND.ON=Red
FOREGROUND.OFF=LightGray
BACKGROUND.ON=Transparent
BACKGROUND.OFF=Transparent

UI_FACE=3Use custom provided images
NOIMG=1No background image
COL_0Color of OFF in UI (UI_FACE != 3)LightGray
COL_1Color of ON in UI (UI_FACE != 3)Yellow or #FFFF00
IMG_OFFImage for OFF (UI_FACE = 3)_PanelImages/LED_OFF.png
IMG_ONImage for ON (UI_FACE = 3)_PanelImages/LED_ON.png

Examples​

0,OUTPUT,1,L_LED1,LED,SPAD_LED; defines a ON/OFF led with tag L_LED1 and index 1

0,OUTPUT,2,L_LED2,LED,SPAD_LED_3COL; defines a 3-color led with tag L_LED2 and index 2

0,OUTPUT,3,L_LED3,LED,SPAD_LED_C,COLORSET=1; defines a custom led with tag L_LED3 and index 3 using the defined colorset 1 (See COLORSET)

Device output DISPLAY​

A display is any kind of alphanumerical output. It can e.g. be a 7-Segemnt lcd or a complex display with 5 rows of 20 characters each

The only available <Inherits> for a display is

SPAD_DISPLAY

All configuration is done via the options:

OptionValueDescription
LENGTHintegerLength of each row in characters
ROWSintegernumber of rows
SEGMENTSintegernumber of segements per row. Each segments will be LENGTH/SEGEMENTS width (Default: 0)
DEFAULTanyDefault value to display
NOPADDING0|1Disable padding and aligment of output values
NOSEGMENTROWEVENTS0|1SPAD will only send updates per row, not per segment
SEGMENTALIGNLEFT|RIGHT (... per segment)Alignment of segment value (Default: Right)
TEXTALIGNLEFT|RIGHTAligment of row (Default: right)
FONTstringName of the font to use (Default: Builtin LCD Font)
FOREGROUND#RRGGBBForground color (Default: Blue #FFF0F8)
BACKGROUND#RRGGBBBackground color (Default: Black #000000)
FONTSIZEnumberSize of the UI font (Default: Height of one display row)
HEIGHTnumberHeight of display in pixels (UI)
WIDTHnumberWidth of display in pixels (UI)

Examples

0,OUTPUT,1,D_1,DISPLAY,SPAD_DISPLAY,LENGTH=6,ROWS=1,WIDTH=133,HEIGHT=40

One row with 6 characters

0,OUTPUT,1,D_1,DISPLAY,SPAD_DISPLAY,LENGTH=15,ROWS=3,WIDTH=350,HEIGHT=120

3 rows woth 15 chars each

0,OUTPUT,1,D_1,DISPLAY,SPAD_DISPLAY,LENGTH=24,ROWS=12,WIDTH=400,HEIGHT=300,FONTSIZE=16

12 Rows with 24 chars each

Other outputs​

Forany other kind of output (e.g. a servo) no output needs to be defined. Just provide a RW-data for the output using the ADD command and act on the device accordingly to changes to that data