diff --git a/robot/protocol.ts b/robot/protocol.ts index 3944ab7e..2c14bdec 100644 --- a/robot/protocol.ts +++ b/robot/protocol.ts @@ -3,9 +3,7 @@ namespace microcode { export enum RobotCommand { MotorRun = 0x0001, - } - export enum RobotDrivers { - MicroMaqqueen = 0x01 + LedSetColor = 0x0002, } export function createRobotCommand(cmd: RobotCommand, payload: Buffer) { diff --git a/robot/radio.ts b/robot/radio.ts index de5951ce..bab6de59 100644 --- a/robot/radio.ts +++ b/robot/radio.ts @@ -45,6 +45,13 @@ namespace microcode { robot.motorRun(speed) break } + case RobotCommand.LedSetColor: { + const red = payload[0] + const green = payload[1] + const blue = payload[2] + console.log(`led set color ${red} ${green} ${blue}`) + robot.ledSetColor(red, green, blue) + } } }) } \ No newline at end of file