LED Board
Load Light and Sound Style from Resource Library
style = lebai:load_led_style(name, dir)
Parameters
name
Namedir
Workspace name. Optional, default root directory
Returns
style
Light and sound stylemode
. Light mode.speed
. Speed.colors
. Light colors.voice
. Sound list.volume
. Volume.
JSON-RPC
// Request:
{ "jsonrpc": "2.0", "method": "load_led_style", "params": [{"name": "", "dir": ""}], "id": 1 }
// Response:
{ "jsonrpc": "2.0", "result": {"led": {}, "voice": 0, "volume": 0}, "id": 1 }
Set Light and Sound Style
lebai:set_led_style(style)
- Parameters
style
Light and sound stylemode
. Light mode.speed
. Speed.colors
. Light colors.voice
. Sound list.volume
. Volume.
Set LED Light Status
lebai:set_led(mode, speed, colors)
- Parameters
mode
. Light mode.0
Unchanged.1
Off.2
Steady on.3
Breathing.4
Equal division rotation.5
Same color rotation.6
Flashing.
speed
. Speed.1
Fast.2
Normal.3
Slow.
colors
. Up to 4 integers between 0 ~ 15, corresponding colors as follows:
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
JSON-RPC
// Request:
{ "jsonrpc": "2.0", "method": "set_led", "params": [{"mode": 1, "speed": 1, "colors": [0]}], "id": 1 }
// Response:
{ "jsonrpc": "2.0", "result": {}, "id": 1 }
Set Sound
lebai:set_voice(voice, volume)
- Parameters
voice
. Sound list.0
Unchanged1
LEBAI is starting up, please wait2
LEBAI is trying to stop3
Warning, collision detected4
Updating, please wait5
Teaching mode enabled6
Teaching mode exited7
Fine-tuning started8
Fine-tuning ended9
Fine-tuning direction changed10
LEBAI is bored, let's play a game together
volume
. Volume.0
Mute.1
Low.2
Normal.3
High.
JSON-RPC
// Request:
{ "jsonrpc": "2.0", "method": "set_voice", "params": [{"voice": 1, "volume": 1}], "id": 1 }
// Response:
{ "jsonrpc": "2.0", "result": {}, "id": 1 }
Turn Fan On/Off
lebai:set_fan(status)
Note
When the system detects that the robot's operating temperature is too high, it will automatically turn on the cooling fan.
- Parameters
status
.1
Off.2
On.
JSON-RPC
// Request:
{ "jsonrpc": "2.0", "method": "set_fan", "params": [{"mode": 1}], "id": 1 }
// Response:
{ "jsonrpc": "2.0", "result": {}, "id": 1 }