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=1

Enabled updates of the led-labeltext (UI_FACE=2) via events

UI_FACE=0

A round led that changed fillcolor depending on it's state

UI_FACE=1

A rectangular led that changes foreground-color depending on it's state

FOREGROUND=Red

UI_FACE=2

A 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=3

Use custom provided images

NOIMG=1

No background image

COL_0

Color of OFF in UI (UI_FACE != 3)

LightGray

COL_1

Color of ON in UI (UI_FACE != 3)

Yellow or #FFFF00

IMG_OFF

Image for OFF (UI_FACE = 3)

_PanelImages/LED_OFF.png

IMG_ON

Image 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

LENGTH

integer

Length of each row in characters

ROWS

integer

number of rows

SEGMENTS

integer

number of segements per row. Each segments will be LENGTH/SEGEMENTS width (Default: 0)

DEFAULT

any

Default value to display

NOPADDING

0|1

Disable padding and aligment of output values

NOSEGMENTROWEVENTS

0|1

SPAD will only send updates per row, not per segment

SEGMENTALIGN

LEFT|RIGHT (... per segment)

Alignment of segment value (Default: Right)

TEXTALIGN

LEFT|RIGHT

Aligment of row (Default: right)

FONT

string

Name of the font to use (Default: Builtin LCD Font)

FOREGROUND

#RRGGBB

Forground color (Default: Blue #FFF0F8)

BACKGROUND

#RRGGBB

Background color (Default: Black #000000)

FONTSIZE

number

Size of the UI font (Default: Height of one display row)

HEIGHT

number

Height of display in pixels (UI)

WIDTH

number

Width of display in pixels (UI)

Examples

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

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

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

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

Last updated