aaaf5050_mc_k12_open aaaf5050_mc_k12_write navigation bar

Table of Contents

aaaf5050_mc_k12_close

Closes a Kingbright AAAF5050-MC-K12 LED strip.

Description

The aaaf5050_mc_k12_close function closes the Kingbright AAAF5050-MC-K12 LED strip, releasing any allocated resources. Once the LED strip has been closed, the LED strip handle is no longer valid and may not be used.

Prototype

t_error
aaaf5050_mc_k12_close(t_aaaf5050_mc_k12 led_handle);
    

Parameters

t_aaaf5050_mc_k12 led_handle

A handle to the LED strip returned by the aaaf5050_mc_k12_open function.

Return value

The return value is 0 if the LED strip is closed successfully. Otherwise a negative error code is returned. Error codes are defined in quanser_errors.h. A suitable error message may be retrieved using msg_get_error_message.

Error codes

QERR_INVALID_ARGUMENT

One of the arguments is invalid.

Requirements

Include Files

Libraries

quanser_led.h

quanser_devices.lib;quanser_communications.lib;quanser_runtime.lib;quanser_common.lib

Examples

t_aaaf5050_mc_k12 led_strip;
t_error result = 
    aaaf5050_mc_k12_open("spi://localhost:1?memsize=420,word=8,baud=3333333,lsb=off,frame=1", 33, &led_strip);
if (result == 0) {
    ...
    aaaf5050_mc_k12_close(led_strip);
} else {
    TCHAR message[512];
    msg_get_error_message(NULL, result, message, sizeof(message));
    _tprintf(_T("Failed to open LED strip. %s (error %d)\n"), message, -result);
}
    

See Also

 

navigation bar