Skip to content

Three-color Light Control

Method

setSerialPortLight(cmds) → {Promise.<any>}

Turn on the three-color light.

Parameters

Name Type Description
cmds Objecct Command set: {"cmds": ["A0 01 01 A2"]}
Turn off yellow light: A0 01 00 A1
Turn on yellow light: A0 01 01 A2
Yellow light blinking: A0 01 02 A3
Turn off green light: A0 02 00 A2
Turn on green light: A0 02 01 A3
Green light blinking: A0 02 02 A4
Turn off red light: A0 03 00 A3
Turn on red light: A0 03 01 A4
Red light blinking: A0 03 02 A5
Turn off buzzer: A0 04 00 A4
Turn on buzzer: A0 04 01 A5
Intermittent buzzer: A0 04 02 A6
Turn off red light + buzzer: A0 07 00 A7
Turn on red light + buzzer: A0 07 01 A8
Red light blinking + buzzer: A0 07 02 A9
Turn off all: A0 00 00 A0
Turn on all: A0 00 01 A1
All blinking: A0 00 02 A2
Note: Supported from SDK version 1.0.119 onwards

Return Value Promise.<any>

Command result

  • {
  • "code": 0, // 0: Success; 1: Device not found; 2: Serial port open failed; 3: Command sending failed
  • "data": [{// Command sending and feedback information
  • "feedback": "A00101A2",
  • "cmd": "A00101A2"
  • }],
  • "errText": "error" // Error message
  • }

Example

JavaScript
1
2
3
...
const success = await axRobot.setSerialPortLight("<cmds>");
...