Enumerations | Functions
Lights

Access to EV3 GREEN and RED LEDs at once. More...

Enumerations

enum  { LIT_LEFT, LIT_RIGHT, LIT__LOC__ }
 Identifiers of light locations.
 
enum  {
  LIT_OFF, LIT_GREEN, LIT_RED, LIT_AMBER,
  LIT__COL__
}
 Identifiers of light colors.
 

Functions

 EV3_LIGHT_VAR_INIT (const char *const LIT_COLOR[],{"OFF","GREEN","RED","AMBER", STR_unknown_})
 Light colors.
 
const char * light_color (uint8_t col)
 Get the light color name. More...
 
void set_light (uint8_t loc, uint8_t col)
 Set the light color. More...
 
uint8_t get_light (uint8_t loc)
 Get the light color. More...
 
void set_light_trigger (uint8_t loc, uint8_t col, uint8_t trigger)
 Set the light trigger. More...
 
uint8_t get_light_trigger (uint8_t loc, uint8_t col)
 Get the light trigger. More...
 
void set_light_blink (uint8_t loc, uint8_t col, int delay_on, int delay_off)
 Set the light blink. More...
 
bool get_light_blink (uint8_t loc, uint8_t col)
 Check the light is blinking. More...
 

Detailed Description

Access to EV3 GREEN and RED LEDs at once.

Function Documentation

uint8_t get_light ( uint8_t  loc)

Get the light color.

Parameters
locLocation.
Returns
Color.
bool get_light_blink ( uint8_t  loc,
uint8_t  col 
)

Check the light is blinking.

Parameters
locLocation.
colColor.
Returns
Flag - the light is blinking.
uint8_t get_light_trigger ( uint8_t  loc,
uint8_t  col 
)

Get the light trigger.

Parameters
locLocation.
colColor.
Returns
Index of trigger or TRIGGER__COUNT_ - error has occurred.
const char* light_color ( uint8_t  col)

Get the light color name.

Parameters
colColor.
Returns
Color name.
void set_light ( uint8_t  loc,
uint8_t  col 
)

Set the light color.

Parameters
locLocation.
colColor.
void set_light_blink ( uint8_t  loc,
uint8_t  col,
int  delay_on,
int  delay_off 
)

Set the light blink.

Parameters
locLocation.
colColor.
delay_onTime of "on" state in ms.
delay_offTime of "off" state in ms.
void set_light_trigger ( uint8_t  loc,
uint8_t  col,
uint8_t  trigger 
)

Set the light trigger.

Parameters
locLocation.
colColor.
triggerIndex of trigger.