Open topic with navigation

# Target LED API

## Detailed Description

This set of functions controls the LED light on a tracker target. Currently, only the zSpace stylus has this capability.

## List of Functions
ZSError | zsSetTargetLedEnabled (ZSHandle targetHandle, ZSBool isLedEnabled)
ZSError | zsIsTargetLedEnabled (ZSHandle targetHandle, ZSBool* isLedEnabled)
ZSError | zsIsTargetLedOn (ZSHandle targetHandle, ZSBool* isLedOn)
ZSError | zsSetTargetLedColor (ZSHandle targetHandle, ZSFloat r, ZSFloat g, ZSFloat b)
ZSError | zsGetTargetLedColor (ZSHandle targetHandle, ZSFloat* r, ZSFloat* g, ZSFloat* b)

## Function Descriptions

ZSError zsGetTargetLedColor | ( | ZSHandle | targetHandle,
|  | ZSFloat* | r,
|  | ZSFloat* | g,
|  | ZSFloat* | b
| ) |  |

Gets the rgb values of a tracker target's LED light.

Parameters:

  [in] | targetHandle | A handle to the tracker target.
  [out] | r | 1 if red is on, 0 otherwise.
  [out] | g | 1 if green is on, 0 otherwise.
  [out] | b | 1 if blue is on, 0 otherwise.

ZSError zsIsTargetLedEnabled | ( | ZSHandle | targetHandle,
|  | ZSBool* | isLedEnabled
| ) |  |

Checks whether a tracker target's LED light is enabled.

Parameters:

  [in] | targetHandle | A handle to the tracker target.
  [out] | isLedEnabled | True if enabled, false otherwise.

ZSError zsIsTargetLedOn | ( | ZSHandle | targetHandle,
|  | ZSBool* | isLedOn
| ) |  |

Checks whether a tracker target's LED light is on.

Parameters:

  [in] | targetHandle | A handle to the tracker target.
  [out] | isLedOn | True if on, false otherwise.

ZSError zsSetTargetLedColor | ( | ZSHandle | targetHandle,
|  | ZSFloat | r,
|  | ZSFloat | g,
|  | ZSFloat | b
| ) |  |

Sets the color of a tracker target's LED light.

Parameters:

  [in] | targetHandle | A handle to the tracker target.
  [in] | r | 1 to turn red on, 0 to turn red off.
  [in] | g | 1 to turn green on, 0 to turn green off.
  [in] | b | 1 to turn blue on, 0 to turn blue off.

Example:

       ZSContext context = ...;

       // Get a handle to the stylus target.
       ZSHandle stylusHandle = NULL;
       zsFindTargetByType(context, ZS_TARGET_TYPE_PRIMARY, 0, &stylusHandle);

       // Enable the stylus' LED.
       zsSetTargetLedEnabled(stylusHandle, true);

       // Set LED to red.
       zsSetTargetLedColor(stylusHandle, 1, 0, 0);

ZSError zsSetTargetLedEnabled | ( | ZSHandle | targetHandle,
|  | ZSBool | isLedEnabled
| ) |  |

Sets whether a tracker target's LED light is enabled.

Parameters:

  [in] | targetHandle | A handle to the tracker target.
  [in] | isLedEnabled | True to enable the LED, false otherwise.

Open topic with navigation