SpaceControl DLL  Version 2.8.9
API documentation for the SpaceControl 3D input devices
Functions for handling the display

These functions handle the brightness of the LCD and are used to write strings to it. More...

Functions

ScStatus scGetLcd (int devIdx, int *brightnessP)
 Retrieves the LCD's brightness. More...
 
ScStatus scSetLcd (int devIdx, int *brightnessP)
 Sets and retrieves the LCD's brightness
Example: More...
 
ScStatus scSetLcdColor (int devIdx, int *redP, int *greenP, int *blueP)
 Sets and retrieves the LCD's background color. More...
 
ScStatus scSetDsplString (int devIdx, int row, char text[MAX_DSPL_STR_LEN], int *charNumP)
 Sets a line of text into the display. More...
 

Detailed Description

These functions handle the brightness of the LCD and are used to write strings to it.

Function Documentation

◆ scGetLcd()

ScStatus scGetLcd ( int  devIdx,
int *  brightnessP 
)

Retrieves the LCD's brightness.


Example:

int devIdx = 0;
int brightness;
ScStatus status = scGetLcd(devIdx, &brightness);
if (status == SC_OK)
printf("display's brightness: %d\n", brightness);
else
printf("error\n");
Parameters
devIdxthe index of the device to be requested
Return values
brightnessPactual brightness (1..15)
Returns
SC_OK, SC_COMMUNICATION_ERROR, SC_WRONG_DEVICE_INDEX

References SC_COMMUNICATION_ERROR, SC_OK, and SC_WRONG_DEVICE_INDEX.

◆ scSetDsplString()

ScStatus scSetDsplString ( int  devIdx,
int  row,
char  text[MAX_DSPL_STR_LEN],
int *  charNumP 
)

Sets a line of text into the display.

The max. length is defined by MAX_DSPL_STR_LEN (= 40).
Example:

int devIdx = 0;
int row = 2;
char* textP = "This is my text.";
int charNum;
ScStatus status = scSetDsplString(devIdx, row, textP, &charNum);
if (status == SC_OK)
printf("%d characters set into line %d.", charNum, row);
else
printf("error\n");
Parameters
devIdxthe index of the device to be used
rowthe line the text is to be put into (0..6)
textnull terminated string with the text
Return values
charNumP*charNumP: the number of characters actually written
Returns
SC_OK, SC_COMMUNICATION_ERROR, SC_WRONG_DEVICE_INDEX

References MAX_DSPL_STR_LEN, SC_COMMUNICATION_ERROR, SC_OK, SC_PARAMETER_OUT_OF_RANGE, and SC_WRONG_DEVICE_INDEX.

◆ scSetLcd()

ScStatus scSetLcd ( int  devIdx,
int *  brightnessP 
)

Sets and retrieves the LCD's brightness
Example:

int devIdx = 0;
int brightness = 12;
ScStatus status = scSetLcd(devIdx, &brightness);
if (status == SC_OK)
printf("display's brightness: %d\n", brightness);
else
printf("error\n");
Parameters
devIdxthe index of the device to be requested
Return values
brightnessPactual brightness (1..15)
Returns
SC_OK, SC_COMMUNICATION_ERROR, SC_WRONG_DEVICE_INDEX, SC_PARAMETER_OUT_OF_RANGE

References MAX_BRIGHTNESS, MIN_BRIGHTNESS, SC_COMMUNICATION_ERROR, SC_OK, SC_PARAMETER_OUT_OF_RANGE, and SC_WRONG_DEVICE_INDEX.

◆ scSetLcdColor()

ScStatus scSetLcdColor ( int  devIdx,
int *  redP,
int *  greenP,
int *  blueP 
)

Sets and retrieves the LCD's background color.

This function is for testing purposes only and sets the LCD to a monochrome color. The color values are given as RGB in the range 0 .. 255. But, the display does not have the full color range, the values are mapped as follows automatically:

  • Red: 0..255 -> 0..31 (5 bit)
  • Green: 0..255 -> 0..63 (6 bit)
  • Blue: 0..255 -> 0..31 (5 bit) Due to unavoidable rounding errors concerning the mapping the values given back will not be the same as you have put in. Example:
    int devIdx = 0;
    int red = 255;
    int green = 100;
    int blue = 100; // gives a light red alltogether
    ScStatus status = scSetLcdColor(devIdx, &red, &green, &blue);
    if (status == SC_OK)
    printf("green: %d\n", green);
    else
    printf("error\n");
    Parameters
    devIdxthe index of the device to be requested
    Return values
    redPred part of the color (0..255)
    greenPgreen part of the color (0..255)
    bluePblue part of the color (0..255)
    Returns
    SC_OK, SC_COMMUNICATION_ERROR, SC_WRONG_DEVICE_INDEX, SC_PARAMETER_OUT_OF_RANGE

References MAX_COLOR_VAL, MIN_COLOR_VAL, SC_COMMUNICATION_ERROR, SC_OK, SC_PARAMETER_OUT_OF_RANGE, and SC_WRONG_DEVICE_INDEX.

SC DLL

SpaceControl Copyright (c) SpaceControl GmbH & Co. KG, Am Technologiepark 10, D-82229 Seefeld
Generated by Doxygen