beautypg.com

D.7 programming example, D.7.1 turn on led - single, D.7.2 urn on led - multiple – IEI Integration IBS-19A User Manual

Page 152: Rogramming, Xample, Ibs-19a series medical panel pc page 21

background image

IBS-19A Series Medical Panel PC

Page 21

D.7 Programming Example

Some example programs are provided below. Please modify it by the language you use.

D.7.1 Turn on LED - single

{

//Define Data structure

PLED_PWM_INFO LEDCOLOR = (PLED_PWM_INFO)malloc(sizeof(LED_PWM_INFO));

HANDLE hSMB_Dev = LIGHTBAR_DriverInit();//Init SMBAPI driver and get device Handle.

LIGHTBAR_DeviceInit(hSMB_Dev);//Init Target device

//Set LED level information.

LEDCOLOR.R_LEVEL = 7;

LEDCOLOR.G_LEVEL = 7;

LEDCOLOR.B_LEVEL = 7;

//Set LED Address

LEDCOLOR.LED_Info.Main_Addr = 0xC0;

LEDCOLOR.LED_Info.R_LN = 0x00;

LEDCOLOR.LED_Info.G_LN = 0x01;

LEDCOLOR.LED_Info.B_LN = 0x02;

If(LIGHTBAR_Brightness_Single(hSMB_Dev, LEDCOLOR, 1) == False){

//Error message

}

LIGHTBAR_DeviceClose(hSMB_Dev); //Close

Device.

LIGHTBAR_DriverUninit(hSMB_Dev); //Close

Driver

Handle

delete LEDCOLOR;

}

D.7.2 urn on LED - multiple

{

//Define Data structure

PLED_PWM_INFO LEDCOLOR = (PLED_PWM_INFO)malloc(sizeof(LED_PWM_INFO) * 4);