Light
This file contains a procedures to control the EV3 or Powered Up light.
Constants
The light module.
Source: lib/modules/light.whl, line: 9
Module call to control the light.
Source: lib/modules/light.whl, line: 12
EV3 Light colors and modes.
Source: lib/modules/light.whl, line: 15
LIGHT_OFF | 0 |
LIGHT_GREEN | 1 |
LIGHT_RED | 2 |
LIGHT_ORANGE | 3 |
LIGHT_GREEN_FLASH | 4 |
LIGHT_RED_FLASH | 5 |
LIGHT_ORANGE_FLASH | 6 |
LIGHT_GREEN_PULSE | 7 |
LIGHT_RED_PULSE | 8 |
LIGHT_ORANGE_PULSE | 9 |
Powered Up light colors.
Source: lib/modules/light.whl, line: 27
LIGHT_PU_BLACK | 0 |
LIGHT_PU_PINK | 1 |
LIGHT_PU_PURPLE | 2 |
LIGHT_PU_BLUE | 3 |
LIGHT_PU_LIGHT_BLUE | 4 |
LIGHT_PU_CYAN | 5 |
LIGHT_PU_GREEN | 6 |
LIGHT_PU_YELLOW | 7 |
LIGHT_PU_ORANGE | 8 |
LIGHT_PU_RED | 9 |
LIGHT_PU_WHITE | 10 |
LIGHT_PU_NONE | 255 |
Spike light colors.
Source: lib/modules/light.whl, line: 41
LIGHT_SPIKE_PINK | 1 |
LIGHT_SPIKE_VIOLET | 2 |
LIGHT_SPIKE_BLUE | 3 |
LIGHT_SPIKE_AZURE | 4 |
LIGHT_SPIKE_CYAN | 5 |
LIGHT_SPIKE_GREEN | 6 |
LIGHT_SPIKE_YELLOW | 7 |
LIGHT_SPIKE_ORANGE | 8 |
LIGHT_SPIKE_RED | 9 |
LIGHT_SPIKE_WHITE | 10 |
Procedures
lightLayer
Source: lib/modules/light.whl, line: 53
Turn the light on or off.
proc lightLayer(number layer, number mode)
Parameters:
Name | Type | Description |
layer | number | The layer, only applies to Powered Up and Spike. |
mode | number | The color and pattern. |
light
Source: lib/modules/light.whl, line: 61
Turn the light on or off.
proc light(number mode)
Parameters:
Name | Type | Description |
mode | number | The color and pattern. |
With the light module you can control the EV3 light.
#include "lib/modules/standard.whl"
#include "lib/modules/light.whl"
proc main()
light(LIGHT_RED, LIGHT_FLASH_OFF)
sleep(1000)
light(LIGHT_ORANGE, LIGHT_FLASH_ON)
sleep(3000)
light(LIGHT_ORANGE, LIGHT_FLASH_OFF)
sleep(1000)
light(LIGHT_OFF, LIGHT_FLASH_OFF)
end